home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / e_os300b / eos300.doc < prev    next >
Encoding:
Text File  |  1996-12-11  |  229.5 KB  |  5,810 lines

  1. ───────────────────────────────────────────────────────────────────────────────
  2.                      ┌─────────┐ ┌─────────┐ ┌─────────┐
  3.                      └┐  ┌───┐ │ │  ┌───┐  │ │  ┌────┐ │
  4.                       │  │   └─┘ │  │   │  │ │  │    └─┘
  5.                       │  └──┐    │  │   │  │ │  └──────┐
  6.                       │  ┌──┘    │  │   │  │ └──────┐  │
  7.                       │  │   ┌─┐ │  │   │  │ ┌─┐    │  │
  8.                      ┌┘  └───┘ │ │  └───┘  │ │ └────┘  │
  9.                      └─────────┘ └─────────┘ └─────────┘
  10. ───────────────────────────────────────────────────────────────────────────────
  11.  
  12. ───────────────────────────────────────────────────────────────────────────────
  13.  
  14.               E.O.S Eclipse Operating System  Version 3.00 Bêta
  15.  
  16.                         Copyright (c) Eclipse 1995-96
  17.  
  18. ───────────────────────────────────────────────────────────────────────────────
  19.  
  20.  
  21. ╔══════════════════════════════════════════════════════════════════════════╗
  22. ║                                                                          ║
  23. ║ Nouveautés de la version 3.00                                            ║
  24. ║                                                                          ║
  25. ╚══════════════════════════════════════════════════════════════════════════╝
  26.  
  27.         * Un seul fichier E.O.S (plus de fichier kernel).
  28.         * Compatibilité totale avec Windows 95, Windows 3.1 et Dos.
  29.         * Nouvelles librairies pour les utilisateurs de WATCOM C++.
  30.         * Possibilité d'utiliser l'E.O.S à la place de DOS4GW.
  31.         * Support du VESA 2.0 (Linear frame buffer).
  32.         * Support du VESA 1.0 (Automatic Bank Switching) en lecture et écriture.
  33.         * Nouvelle interruption pour remapper la mémoire.
  34.         * Nouveau debugger en externe pour tracer des programmes au format LE.
  35.         * Serveur DPMI Version 0.90.
  36.         * Nouvelle gestion de la mémoire par handle.
  37.         * Possibilité de linker des données sans les compresser.
  38.         * Possibilité d'utiliser l'E.O.S en externe sous WATCOM (WSTUB).
  39.         * Nouvelle fonction de synchronisation beaucoup plus stable sous
  40.           Windows 95.
  41.         * Nouveau player de module :
  42.            - Mixage automatique sur 8 ou 16bits en fonction de la carte.
  43.            - Meilleure restitution sonore sur les cartes Sound Blaster.
  44.            - Support de la Windows Sound System.
  45.            - Gestion des samples indépendamment de la musique.
  46.            - Détection manuelle ou automatique des cartes sonores.
  47.  
  48.  
  49. ╔══════════════════════════════════════════════════════════════════════════╗
  50. ║                                                                          ║
  51. ║ Table des matières                                                       ║
  52. ║                                                                          ║
  53. ╚══════════════════════════════════════════════════════════════════════════╝
  54.  
  55.       Présentation des différents modules de l'E.O.S
  56.       Comment créer un fichier OBJ
  57.       Comment créer un fichier EXE
  58.       Utilisation d'un fichier makefile avec Turbo Assembler
  59.       Utilisation d'un fichier makefile avec WATCOM C++
  60.       Le fichier include
  61.       Les différentes fonctionnalités de l'E.O.S
  62.       Les déclarations générales
  63.       La gestion mémoire
  64.       Les fonctions pour la gestion mémoire
  65.            │Allocate Memory
  66.            │DeAllocate Memory
  67.            │Allocate Memory Handle
  68.            │DeAllocate Memory Handle
  69.            │Resize Memory Handle
  70.            │Allocate Selector
  71.            │DeAllocate Selector
  72.            │Physical Address Mapping
  73.            │Free Physical Address Mapping
  74.       La gestion de fichiers
  75.       Les fonctions pour la gestion de fichiers
  76.            │Load Internal File
  77.            │Load External File
  78.            │Load Internal File Handle
  79.            │Load External File Handle
  80.            │Write External File
  81.       La gestion des cartes sonores
  82.       Comment accéder aux différentes variables d'un module
  83.       Les effets sonores
  84.       Absence de carte sonores
  85.       Les déclarations du player de module
  86.       Les fonctions pour jouer une musique ou des effets sonores
  87.            │Detect Sound Card
  88.            │Manual Setup
  89.            │Load Module
  90.            │Play Module
  91.            │Stop Module
  92.            │Clear Module
  93.            │Set Volume
  94.            │Play Sample
  95.            │Get Info
  96.            │Set Pattern
  97.       Gestion d'un second écran monochrome
  98.       Les fonctions pour utiliser un second écran pour le debuggage
  99.            │Set Mono
  100.            │Set String Mono
  101.            │Set Value Mono
  102.       Le clavier
  103.            │Use Int 09
  104.       Synchronisation avec le balayage
  105.       Les fonctions de synchronisations
  106.            │Wait Vbl
  107.            │Use Int 08
  108.            │Change Synchro Int 08
  109.       Les variables
  110.            │Code32 Sel
  111.            │Data32 Sel
  112.            │Flat Data Sel
  113.            │Flat Code Sel
  114.            │Sélecteur 40h
  115.            │Real DS
  116.            │Real ES
  117.            │Real FS
  118.            │Real GS
  119.            │Real SS
  120.            │Real SP
  121.            │0b0000h
  122.            │0b8000h
  123.            │0a0000h
  124.       Les Macros
  125.            │Colors
  126.            │Get Param
  127.            │Send
  128.            │DosInt
  129.            │DosCall
  130.            │Init ES DI
  131.            │Init DS DX
  132.       Le mode réel
  133.       Les interruptions
  134.       Les IRQ ou interruptions matérielles
  135.       Les Exceptions
  136.       Les fonctions pour gérer les interruptions
  137.            │Get Int
  138.            │Set Int
  139.            │Get Irq
  140.            │Set Irq
  141.       Le linker
  142.       Le Debugger 32 bits
  143.       Les fonctions du Debuggeur 32 bits
  144.            │Debug
  145.            │Debug Back
  146.       Appel du debugger par Break point
  147.            │Break Point
  148.       Restitution automatique de l'environement de départ
  149.       Les fonctions système
  150.            │Exit Error
  151.            │Restore Video Mode
  152.            │Detect Windows
  153.            │Direct Send
  154.       Comment développer une librairie compatible WATCOM C et E.O.S
  155.            │La gestion mémoire sous WATCOM
  156.            │Les appels aux interruptions en mode REEL
  157.            │Les variables inutilisables sous WATCOM
  158.            │Différence entre les fichiers sources
  159.       Les librairies de l'E.O.S
  160.       La librairie VESA
  161.            │Automatic Bank Switching en VESA 1.0 ou 2.0
  162.            │Linear Frame Buffer en VESA 2.0
  163.       Les fonctions de la librairie VESA
  164.            │Init Vesa
  165.            │Init Vesa2
  166.            │Init Vesa Bank
  167.            │Close Vesa Bank
  168.            │Set Bank
  169.       Les variables de la librairie VESA
  170.            │Vesa Clear Palette
  171.       Les déclarations de la librairie VESA
  172.       La librairie FLI32
  173.       Les fonctions de la librairie FLI32
  174.            │Load Fli
  175.            │Load Internal Fli
  176.            │First Frame Fli
  177.            │Next Frame Fli
  178.            │Dispose Fli
  179.       La librairie SNAP
  180.       Les fonctions de la librairie SNAP
  181.            │Init Snap
  182.            │Snap IFF
  183.            │Save IFF
  184.       La librairie JOYSTICK
  185.       Les fonctions de la librairie JOYSTICK
  186.            │Init Joystick
  187.            │Dectect Joystick
  188.            │Add Joystick
  189.            │Update Joystick
  190.            │Sub Joystick
  191.            │Upper Left
  192.            │Lower Right
  193.            │Center
  194.       Les déclarations de la librairie JOYSTICK
  195.       La librairie mémoire
  196.       Les fonctions de la librairie mémoire
  197.            │Init Memory
  198.       Les fonctions du DPMI (interruption 31h) supportées par l'E.O.S
  199.       Les fonctions du DOS (interruption 21h) supportées par l'E.O.S
  200.  
  201.  
  202. ╔══════════════════════════════════════════════════════════════════════════╗
  203. ║                                                                          ║
  204. ║ Présentation des différents modules de l'E.O.S                           ║
  205. ║                                                                          ║
  206. ╚══════════════════════════════════════════════════════════════════════════╝
  207.  
  208. L'E.O.S est constitué de plusieurs fichiers.
  209.  
  210.  
  211. ───────────────────────────────────────────────────────────────────────────────
  212. Version d'évaluation
  213. ───────────────────────────────────────────────────────────────────────────────
  214.  
  215.         Les objets de base pour Tasm et Masm :
  216.  
  217.                 ■ EOS.OBJ       Le coeur du système qui supporte Diamond.
  218.                 ■ EOSLITE.OBJ   La version allégée si vous n'utilisez pas
  219.                 ■ DIAMOND.OBJ   Le player de module 32 voies.
  220.  
  221.                 ■ EOS.INC       Le fichier include.
  222.  
  223.  
  224.         Les objets de base pour WATCOM C++ :
  225.  
  226.                 ■ WEOS.EXE      Le coeur du système qui supporte Diamond.
  227.                   WSTARTUP.OBJ
  228.                   WATCOM.OBJ
  229.                 ■ WEOSLITE.EXE  La version allégée si vous n'utilisez pas
  230.                                 le player Diamond.
  231.  
  232.                 ■ EOS.H         Le fichier include.
  233.  
  234.  
  235.         Le debuggeur pour Tasm, Masm et WATCOM C++ :
  236.  
  237.                 ■ DEBUG.OBJ     Pour tracer du code 32 bits.
  238.  
  239.  
  240.         Les outils :
  241.  
  242.                 ■ LLINK.EXE     Pour créer un seul fichier EXE compressé.
  243.                 ■ CRYPT.EXE     Pour protéger vos données.
  244.                 ■ SCANCODE.EXE  Pour afficher les codes du clavier.
  245.                 ■ 132.EXE       Pour passer en mode 132 colonnes.
  246.                 ■ EDCONFIG.EXE  Pour configurer le debugger
  247.                 ■ DIET.EXE      Pour compresser vos données
  248.  
  249.  
  250. ───────────────────────────────────────────────────────────────────────────────
  251. Version Complète
  252. ───────────────────────────────────────────────────────────────────────────────
  253.  
  254.         Les objets de base pour Tasm et Masm :
  255.  
  256.                 ■ EOS.OBJ       Le coeur du système qui supporte Diamond.
  257.                 ■ EOSLITE.OBJ   La version allégée si vous n'utilisez pas
  258.                                 le player Diamond.
  259.                 ■ DIAMOND.OBJ   Le player de module 32 voies.
  260.  
  261.                 ■ EOS.INC       Le fichier include.
  262.  
  263.  
  264.         Les objets de base pour WATCOM C++ :
  265.  
  266.                 ■ WEOS.EXE      Le coeur du système qui supporte Diamond.
  267.                   WSTARTUP.OBJ
  268.                   WATCOM.OBJ
  269.                 ■ WEOSLITE.EXE  La version allégée si vous n'utilisez pas
  270.                                 le player Diamond.
  271.  
  272.                 ■ EOS.H         Le fichier include.
  273.  
  274.  
  275.         Le debuggeur pour Tasm, Masm et WATCOM C++ :
  276.  
  277.                 ■ DEBUG.OBJ     Pour tracer du code 32 bits.
  278.                *■ MEMORY.OBJ    Pour la gestion de la mémoire.
  279.  
  280.  
  281.         Les Librairies TASM et MASM :
  282.  
  283.                *■ VESA.OBJ      Pour accéder directement au buffer de la
  284.                                 carte graphique sans se préoccuper des
  285.                                 changements de bank en VESA 1.0.
  286.                *■ FLI32.OBJ     Pour visualiser les fichiers FLI et FLC.
  287.                *■ SNAP.OBJ      Pour la capture d'écrans 256 couleurs
  288.                                 au format IFF.
  289.                *■ JOYSTICK.OBJ  Pour la gestion des manettes de jeux.
  290.  
  291.  
  292.         Les librairies pour Wactom C++ :
  293.  
  294.                *■ WVESA.OBJ     Pour accéder directement au buffer de la
  295.                                 carte graphique sans se préoccuper des
  296.                                 changements de bank en VESA 1.0.
  297.                *■ WFLI32.OBJ    Pour visualiser les fichiers FLI et FLC.
  298.                *■ WSNAP.OBJ     Pour la capture d'écrans 256 couleurs
  299.                                 au format IFF.
  300.                *■ WJOYSTICK.OBJ Pour la gestion des manettes de jeux.
  301.  
  302.  
  303.         Les outils :
  304.  
  305.                 ■ LLINK.EXE     Pour créer un seul fichier EXE compressé.
  306.                 ■ CRYPT.EXE     Pour protéger vos données.
  307.                 ■ SCANCODE.EXE  Pour afficher les codes du clavier.
  308.                 ■ 132.EXE       Pour passer en mode 132 colonnes.
  309.                 ■ EDCONFIG.EXE  Pour configurer le debugger
  310.                 ■ DIET.EXE      Pour compresser vos données
  311.                *■ WSTUB.EXE     Pour utiliser l'E.O.S en externe.
  312.                *■ WSTUBLTE.EXE  Version allégée sans Diamond.
  313.                *■ WDEBUG.EXE    Pour debugger des programmes au format LE.
  314.  
  315.  
  316. ╔══════════════════════════════════════════════════════════════════════════╗
  317. ║                                                                          ║
  318. ║ Comment créer un fichier OBJ                                             ║
  319. ║                                                                          ║
  320. ╚══════════════════════════════════════════════════════════════════════════╝
  321.  
  322.          A partir de l'invité de MS-Dos, taper simplement :
  323.  
  324.                 TASM3 Mon_programme.asm /m /q /p
  325.  
  326.  
  327. ╔══════════════════════════════════════════════════════════════════════════╗
  328. ║                                                                          ║
  329. ║ Comment créer un fichier EXE                                             ║
  330. ║                                                                          ║
  331. ╚══════════════════════════════════════════════════════════════════════════╝
  332.  
  333.         Si vous n'utilisez pas le player de module :
  334.  
  335.                 TLINK eoslite+Mon_programme /3 /x
  336.  
  337.  
  338.         Si vous utilisez le player de module :
  339.  
  340.                 TLINK eos+diamond+Mon_programme /3 /x
  341.  
  342.  
  343.         Si vous utilisez une librairie :
  344.  
  345.                 TLINK  eos+diamond+Ma_librairie+Mon_programme /3 /x
  346.  
  347.  
  348. ╔══════════════════════════════════════════════════════════════════════════╗
  349. ║                                                                          ║
  350. ║ Utilisation d'un fichier makefile avec Turbo Assembler                   ║
  351. ║                                                                          ║
  352. ╚══════════════════════════════════════════════════════════════════════════╝
  353.  
  354. Le programme MAKE.EXE de Borland permet d'automatiser les commandes
  355. d'assemblage et de linkage à l'aide d'un seul fichier script.
  356.  
  357. Exemple de fichier makefile :
  358.  
  359.         PRG = EXAMPLE1
  360.         RES = ..\RESOURCE
  361.  
  362.         $(PRG).exe:    $(PRG).obj                  \
  363.  
  364.                 @tlink $(RES)\eoslite              \
  365.                        $(PRG),$(PRG).EXE /3 /x
  366.  
  367.         $(PRG).obj: $(PRG).asm
  368.                 @tasm3  $(PRG) /m /q /p
  369.  
  370. Pour créer votre exécutable, taper simplement MAKE.
  371.  
  372.  
  373. ╔══════════════════════════════════════════════════════════════════════════╗
  374. ║                                                                          ║
  375. ║ Utilisation d'un fichier makefile avec WATCOM C++                        ║
  376. ║                                                                          ║
  377. ╚══════════════════════════════════════════════════════════════════════════╝
  378.  
  379. Le programme WMAKE.EXE de WATCOM permet d'automatiser les commandes
  380. d'assemblage et de linkage comme avec Make.
  381.  
  382. Exemple de fichier makefile :
  383.  
  384.         PROGNAME = TEST
  385.         RES      = ..\RESOURCE
  386.  
  387.         CFLAGS = /i=$(%WATCOM)\H /j /mf /fpi87 /fp3 /4s /oailt -4
  388.         CC = WCC386
  389.  
  390.         .c.obj:
  391.                 $(CC) $(CFLAGS) $*.c
  392.  
  393.         all: $(PROGNAME).exe .SYMBOLIC
  394.  
  395.         $(PROGNAME).obj : $(PROGNAME).c
  396.  
  397.         $(PROGNAME).exe : $(PROGNAME).obj
  398.  
  399.            %create link.opt
  400.            %append link.opt FILE $(PROGNAME)
  401.            %append link.opt LIBPATH $(%WATCOM)\LIB386;$(%WATCOM)\LIB386\DOS
  402.            %append link.opt LIBRARY CLIB3S.LIB
  403.            %append link.opt LIBRARY MATH387S.LIB
  404.            %append link.opt OPTION DOSSEG
  405.            %append link.opt option osname='Eclipse Operating System'
  406.            %append link.opt name $(PROGNAME)
  407.            %append link.opt option stub=$(RES)\WEOSLITE.EXE
  408.            %append link.opt format os2 le
  409.            @wlink @link.opt
  410.            @if exist link.opt del link.opt
  411.  
  412. Pour créer votre exécutable, taper simplement WMAKE.
  413.  
  414.  
  415. ╔══════════════════════════════════════════════════════════════════════════╗
  416. ║                                                                          ║
  417. ║ Le fichier include                                                       ║
  418. ║                                                                          ║
  419. ╚══════════════════════════════════════════════════════════════════════════╝
  420.  
  421. Le fichier include (EOS.INC ou EOS.H) est certainement le fichier le plus
  422. important. Il contient en effet toutes les déclarations des différentes
  423. fonctions, macros et variables de l'E.O.S C'est grâce à lui que votre
  424. programme est en mesure de dialoguer avec l'E.O.S.
  425.  
  426.  
  427. ╔══════════════════════════════════════════════════════════════════════════╗
  428. ║                                                                          ║
  429. ║ Les différentes fonctionnalités de l'E.O.S                               ║
  430. ║                                                                          ║
  431. ╚══════════════════════════════════════════════════════════════════════════╝
  432.  
  433. Le système E.O.S dispose d'un certain nombre de fonctions très utiles que l'on
  434. peut appeler par l'intermédiaire de l'interruption Int_EOS.
  435.  
  436. Il suffit juste d'indiquer la fonction voulue à l'aide du registre AH comme
  437. ci-dessous :
  438.  
  439.         mov ah,Fonction_a_appeler
  440.         Int_EOS
  441.  
  442.  
  443. Les fonctions disponibles sont les suivantes :
  444.  
  445. EOS.OBJ
  446. ┌──────────────────────────────────────────────────────────────────────────┐
  447. │Allocate Memory                                                           │
  448. │DeAllocate Memory                                                         │
  449. │Allocate Memory Handle                                                    │
  450. │DeAllocate Memory Handle                                                  │
  451. │Resize Memory Handle                                                      │
  452. │Allocate Selector                                                         │
  453. │DeAllocate Selector                                                       │
  454. │Physical Address Mapping                                                  │
  455. │Free Physical Address Mapping                                             │
  456. │                                                                          │
  457. │Load Internal File                                                        │
  458. │Load External File                                                        │
  459. │Load Internal File Handle                                                 │
  460. │Load External File Handle                                                 │
  461. │Write External File                                                       │
  462. │                                                                          │
  463. │Set Mono                                                                  │
  464. │Set String Mono                                                           │
  465. │Set Value Mono                                                            │
  466. │                                                                          │
  467. │Use Int 09                                                                │
  468. │                                                                          │
  469. │Wait Vbl                                                                  │
  470. │Use Int 08                                                                │
  471. │Change Synchro Int 08                                                     │
  472. │                                                                          │
  473. │Get Int                                                                   │
  474. │Set Int                                                                   │
  475. │Get Irq                                                                   │
  476. │Set Irq                                                                   │
  477. │                                                                          │
  478. │Exit Error                                                                │
  479. │                                                                          │
  480. │Restore Vidèo Mode                                                        │
  481. │                                                                          │
  482. │Detect Windows                                                            │
  483. │                                                                          │
  484. │Direct Send                                                               │
  485. └──────────────────────────────────────────────────────────────────────────┘
  486.  
  487. DIAMOND.OBJ
  488. ┌──────────────────────────────────────────────────────────────────────────┐
  489. │Detect Sound Card                                                         │
  490. │Manual Setup                                                              │
  491. │Load Module                                                               │
  492. │Play Module                                                               │
  493. │Stop Module                                                               │
  494. │Clear Module                                                              │
  495. │Set Volume                                                                │
  496. │Play Sample                                                               │
  497. │Get Info                                                                  │
  498. │Set Pattern                                                               │
  499. └──────────────────────────────────────────────────────────────────────────┘
  500.  
  501.  
  502. ╔══════════════════════════════════════════════════════════════════════════╗
  503. ║                                                                          ║
  504. ║ Les Déclarations gébérales                                               ║
  505. ║                                                                          ║
  506. ╚══════════════════════════════════════════════════════════════════════════╝
  507.  
  508. Pour faciliter l'écriture de vos programmes, l'E.O.S dispose de quelques
  509. déclarations générales très pratiques :
  510.  
  511.   On         = 1
  512.   Off        = 0
  513.   B          = Byte Ptr
  514.   W          = Word Ptr
  515.   D          = Dword Ptr
  516.   F          = Fword Ptr
  517.   O          = Offset
  518.  
  519. Exemple :
  520.  
  521.         mov edi, O File_Name
  522.  
  523.         ou
  524.  
  525.         mov edi, Offset File_Name
  526.  
  527.  
  528. ╔══════════════════════════════════════════════════════════════════════════╗
  529. ║                                                                          ║
  530. ║ La gestion mémoire                                                       ║
  531. ║                                                                          ║
  532. ╚══════════════════════════════════════════════════════════════════════════╝
  533.  
  534. Avec l'E.O.S, finit les problèmes de mémoire ! Vous pouvez désormais adresser
  535. linéairement toutes la mémoire disponible et cela quelques que soit la
  536. configuration de votre système :
  537.  
  538.         ■ Mode RAW  sans Himem.
  539.         ■ Mode XMS  avec Himem.
  540.         ■ Mode VCPI avec EMS (Emm386 highscan).
  541.         ■ Mode VCPI sans EMS (Emm386 noems).
  542.         ■ Mode DPMI avec Windows 3.1x.
  543.         ■ Mode DPMI avec Windows 95.
  544.         ■ Mode DPMI avec OS/2 2.1 ou OS/2 Warp.
  545.  
  546.  
  547. Pour allouer ou restituer de la mémoire supérieur, une simple
  548. interruption de l 'E.O.S suffit :
  549.  
  550.  
  551.         Allocation sans handle :
  552.  
  553.                 mov ah,Allocate_Memory
  554.                 mov edx,Taille_Allocation
  555.                 Int_EOS
  556.                 jc Not_Enough_Memory
  557.                 mov [Logical_Address_Of_Block],edx
  558.  
  559.  
  560.         Restitution de la dernière allocation :
  561.  
  562.                 mov ah,DeAllocate_Memory
  563.                 Int_EOS
  564.  
  565.  
  566.         Allocation par handle :
  567.  
  568.                 mov ah,Allocate_Memory_Handle
  569.                 mov edx,Taille_Allocation
  570.                 Int_EOS
  571.                 jc Not_Enough_Memory
  572.                 mov [Logical_Address_Of_Block],edx
  573.                 mov [Memory_Handle],edi
  574.  
  575.  
  576.         Restitution par handle :
  577.  
  578.                 mov ah,DeAllocate_Memory_Handle
  579.                 mov edi,[Memory_Handle]
  580.                 Int_EOS
  581.                 jc Invalid_Handle
  582.  
  583.  
  584. Vous pouvez avec la même simplicité créer vos propres sélecteurs et profiter
  585. pleinement de la segmentation du mode protégé.
  586.  
  587.  
  588.         Allocation d'un sélecteur :
  589.  
  590.                 mov ah,Allocate_Selector
  591.                 mov esi,0a0000h     ; Base
  592.                 mov edi,0fh         ; 64ko (0000-ffff)
  593.                 Int_EOS
  594.                 jc No_Free Selector
  595.                 mov [_0a0000h_Sel],bx
  596.  
  597.  
  598.         Restitution d'un sélecteur :
  599.  
  600.                 mov ah,DeAllocate_Selector
  601.                 mov bx,[_0a0000h_Sel]
  602.                 Int_EOS
  603.                 jc Invalid_Selector
  604.  
  605.  
  606. Vous pouvez aussi remapper la mémoire pour accéder linéairement à la carte
  607. graphique :
  608.  
  609.                 mov ah,Physical_Address_Mapping
  610.                 mov ecx,1024*1024
  611.                 mov esi,[Vesa_Linear_Address]
  612.                 Int_EOS
  613.                 jc Not_Enough_Memory
  614.  
  615.  
  616. ╔══════════════════════════════════════════════════════════════════════════╗
  617. ║                                                                          ║
  618. ║ Les fonctions pour la gestion mémoire                                    ║
  619. ║                                                                          ║
  620. ╚══════════════════════════════════════════════════════════════════════════╝
  621.  
  622. ┌─────────────────────────────┐
  623. │Allocate Memory              │
  624. │DeAllocate Memory            │
  625. │Allocate Memory Handle       │
  626. │DeAllocate Memory Handle     │
  627. │Resize Memory Handle         │
  628. │Allocate Selector            │
  629. │DeAllocate Selector          │
  630. │Physical Address Mapping     │
  631. │Free Physical Address Mapping│
  632. └─────────────────────────────┘
  633.  
  634. ┌──────────────────────────────────────────────────────────────────────────┐
  635. │Allocate Memory   Allocate Upper memory                                   │
  636. │                                                                          │
  637. │In :                                                                      │
  638. │        AH = Allocate_Memory                                              │
  639. │       EDX = Size of memory block to allocate in bytes                    │
  640. │                                                                          │
  641. │Out :                                                                     │
  642. │        Carry = 0                                                         │
  643. │             All Done                                                     │
  644. │       EAX = Physical address of the block (work with Flat_Data_Sel)      │
  645. │       EDX = Logical address of the block (work with Data32_Sel)          │
  646. │                                                                          │
  647. │        Carry = 1                                                         │
  648. │             Can't allocate memory                                        │
  649. │       EAX = Largest available free memory                                │
  650. │       EDX = Total available memory                                       │
  651. │                                                                          │
  652. │Other Registers Change : None                                             │
  653. │                                                                          │
  654. │                                                                          │
  655. └──────────────────────────────────────────────────────────────────────────┘
  656.  
  657. Exemple :
  658.             mov ah,Allocate_Memory
  659.             mov edx,[Allocation_Size]
  660.             Int_EOS
  661.             jc Not_Enough_Memory
  662.             mov [Physical_Address_Of_Block],eax     ; Work with Flat_Data_Sel
  663.             mov [Logical_Address_Of_Block],edx      ; Work with Data32_Sel
  664.  
  665.  
  666. ┌──────────────────────────────────────────────────────────────────────────┐
  667. │DeAllocate Memory   Free the last allocate memory                         │
  668. │                                                                          │
  669. │In :                                                                      │
  670. │        AH = DeAllocate_Memory                                            │
  671. │                                                                          │
  672. │Out :                                                                     │
  673. │                                                                          │
  674. │Other Registers Change : None                                             │
  675. │                                                                          │
  676. │                                                                          │
  677. └──────────────────────────────────────────────────────────────────────────┘
  678.  
  679. Exemple :
  680.             mov ah,DeAllocate_Memory
  681.             Int_EOS
  682.  
  683.  
  684. ┌──────────────────────────────────────────────────────────────────────────┐
  685. │Allocate Memory Handle  Allocate Upper memory with handle                 │
  686. │                                                                          │
  687. │In :                                                                      │
  688. │        AH = Allocate_Memory                                              │
  689. │       EDX = Size of memory block to allocate in bytes                    │
  690. │                                                                          │
  691. │Out :                                                                     │
  692. │        Carry = 0                                                         │
  693. │             All Done                                                     │
  694. │       EAX = Physical address of the block (work with Flat_Data_Sel)      │
  695. │       EDX = Logical address of the block (work with Data32_Sel)          │
  696. │       EDI = Handle of Memory                                             │
  697. │                                                                          │
  698. │        Carry = 1                                                         │
  699. │             Can't allocate memory                                        │
  700. │       EAX = Largest available free memory                                │
  701. │       EDX = Total available memory                                       │
  702. │                                                                          │
  703. │Other Registers Change : None                                             │
  704. │                                                                          │
  705. │                                                                          │
  706. └──────────────────────────────────────────────────────────────────────────┘
  707.  
  708. Exemple :
  709.             mov ah,Allocate_Memory_Handle
  710.             mov edx,[Allocation_Size]
  711.             Int_EOS
  712.             jc Not_Enough_Memory
  713.             mov [Physical_Address_Of_Block],eax     ; Work with Flat_Data_Sel
  714.             mov [Logical_Address_Of_Block],edx      ; Work with Data32_Sel
  715.             mov [Memory_Handle],edi
  716.  
  717.  
  718. ┌──────────────────────────────────────────────────────────────────────────┐
  719. │DeAllocate Memory Handle  Free the allocate memory with this handle       │
  720. │                                                                          │
  721. │In :                                                                      │
  722. │        AH = DeAllocate_Memory                                            │
  723. │       EDI = Handle of Memory                                             │
  724. │                                                                          │
  725. │Out :                                                                     │
  726. │        Carry = 0                                                         │
  727. │             All Done                                                     │
  728. │                                                                          │
  729. │        Carry = 1                                                         │
  730. │             Invalid handle                                               │
  731. │                                                                          │
  732. │Other Registers Change : None                                             │
  733. │                                                                          │
  734. │                                                                          │
  735. └──────────────────────────────────────────────────────────────────────────┘
  736.  
  737. Exemple :
  738.             mov ah,DeAllocate_Memory_Handle
  739.             mov edi,[Memory_Handle]
  740.             Int_EOS
  741.             jc Invalid_Handle
  742.  
  743.  
  744. ┌──────────────────────────────────────────────────────────────────────────┐
  745. │Resize Memory Handle    Resize the allocate memory with this handle       │
  746. │                                                                          │
  747. │In :                                                                      │
  748. │        AH = Resize_Memory_Handle                                         │
  749. │       ECX = New Size of the memory block                                 │
  750. │       EDI = Handle of Memory                                             │
  751. │                                                                          │
  752. │Out :                                                                     │
  753. │        Carry = 0                                                         │
  754. │             All Done                                                     │
  755. │       EAX = Physical address of the block (work with Flat_Data_Sel)      │
  756. │       EDX = Logical address of the block (work with Data32_Sel)          │
  757. │       EDI = New Handle of Memory                                         │
  758. │                                                                          │
  759. │        Carry = 1                                                         │
  760. │             Invalid handle                                               │
  761. │             Not Enough Memory                                            │
  762. │                                                                          │
  763. │Other Registers Change : None                                             │
  764. │                                                                          │
  765. │                                                                          │
  766. └──────────────────────────────────────────────────────────────────────────┘
  767.  
  768. Exemple :
  769.             mov ah,Resize_Memory_Handle
  770.             mov edi,[Memory_Handle]
  771.             Int_EOS
  772.             jc Invalid_Handle
  773.             mov [Memory_Handle],edi
  774.             mov [Addr_Memory],edx
  775.  
  776.  
  777. ┌──────────────────────────────────────────────────────────────────────────┐
  778. │Allocate Selector   Create a new selector (Data type)                     │
  779. │                                                                          │
  780. │In :                                                                      │
  781. │        AH = Allocate_Selector                                            │
  782. │       ESI = Physical base address of the new selector                    │
  783. │       EDI = Size of the new selector modulo 4096                         │
  784. │                                                                          │
  785. │Out :                                                                     │
  786. │        Carry = 0                                                         │
  787. │             All Done                                                     │
  788. │        BX = New selector                                                 │
  789. │                                                                          │
  790. │        Carry = 1                                                         │
  791. │             Can't create selector                                        │
  792. │                                                                          │
  793. │Other Registers Change : EAX                                              │
  794. │                                                                          │
  795. │                                                                          │
  796. └──────────────────────────────────────────────────────────────────────────┘
  797.  
  798. Exemple :
  799.             mov ah,Allocate_Selector
  800.             mov esi,0a0000h
  801.             mov edi,0fh         ; 64ko (0000-ffff)
  802.             Int_EOS
  803.             jc No_Free Selector
  804.             mov [_0a0000h_Sel],bx
  805.  
  806.  
  807. ┌──────────────────────────────────────────────────────────────────────────┐
  808. │DeAllocate Selector   Free a Selector                                     │
  809. │                                                                          │
  810. │In :                                                                      │
  811. │        AH = DeAllocate_Selector                                          │
  812. │        BX = Selector                                                     │
  813. │                                                                          │
  814. │Out :                                                                     │
  815. │        Carry = 0                                                         │
  816. │             All Done                                                     │
  817. │                                                                          │
  818. │        Carry = 1                                                         │
  819. │             Can't deallocate selector                                    │
  820. │                                                                          │
  821. │Other Registers Change :  EAX,EBX                                         │
  822. │                                                                          │
  823. │                                                                          │
  824. └──────────────────────────────────────────────────────────────────────────┘
  825.  
  826. Exemple :
  827.             mov ah,DeAllocate_Selector
  828.             mov bx,[_0a0000h_Sel]
  829.             Int_EOS
  830.             jc Invalid_Selector
  831.  
  832.  
  833. ┌──────────────────────────────────────────────────────────────────────────┐
  834. │Physical Address Mapping           Allocate memory mapping                │
  835. │                                                                          │
  836. │In :                                                                      │
  837. │        AH = Physical_Address_Mapping                                     │
  838. │       ECX = Size Of region                                               │
  839. │       ESI = Physical address of memory                                   │
  840. │                                                                          │
  841. │Out :                                                                     │
  842. │        Carry = 0                                                         │
  843. │       ESI = Linear Address of the region                                 │
  844. │             All Done                                                     │
  845. │                                                                          │
  846. │        Carry = 1                                                         │
  847. │             No Room free                                                 │
  848. │                                                                          │
  849. │Other Registers Change : None                                             │
  850. │                                                                          │
  851. │                                                                          │
  852. └──────────────────────────────────────────────────────────────────────────┘
  853.  
  854. Exemple :
  855.             mov ah,Physical_Address_Mapping
  856.             mov ecx,1024*1024
  857.             mov esi,[Vesa_Linear_Address]
  858.             Int_EOS
  859.             jc Not_Enough_Memory
  860. EndIf
  861.  
  862.  
  863. ┌──────────────────────────────────────────────────────────────────────────┐
  864. │Free Physical Address Mapping      Free the allocate memory mapping       │
  865. │                                                                          │
  866. │In :                                                                      │
  867. │        AH = Free_Address_Mapping                                         │
  868. │       ESI = Address of the block to free                                 │
  869. │                                                                          │
  870. │Out :                                                                     │
  871. │        Carry = 0                                                         │
  872. │             All Done                                                     │
  873. │                                                                          │
  874. │        Carry = 1                                                         │
  875. │             Invalid address                                              │
  876. │                                                                          │
  877. │Other Registers Change : None                                             │
  878. │                                                                          │
  879. │                                                                          │
  880. └──────────────────────────────────────────────────────────────────────────┘
  881.  
  882. Exemple :
  883.             mov ah,Free_Physical_Address_Mapping
  884.             mov esi,[Vesa_Linear_Address]
  885.             Int_EOS
  886.             jc Invalid_Address
  887.  
  888.  
  889. ╔══════════════════════════════════════════════════════════════════════════╗
  890. ║                                                                          ║
  891. ║ La gestion de fichiers                                                   ║
  892. ║                                                                          ║
  893. ╚══════════════════════════════════════════════════════════════════════════╝
  894.  
  895. Charger un fichier en mémoire n'est guère plus compliqué.
  896.  
  897.         Chargement d'un fichier externe :
  898.  
  899.                 mov ah,Load_External_File
  900.                 mov edx,offset File_name
  901.                 Int_EOS
  902.                 jc Error_File
  903.                 mov File_Buffer,eax
  904.  
  905.  
  906.         Chargement d'un fichier linké avec LightLink (Linker fournit avec
  907.         l'E.O.S) :
  908.  
  909.                 mov ah,Load_Internal_File
  910.                 mov edx,offset File_name
  911.                 Int_EOS
  912.                 mov File_Buffer,eax
  913.  
  914.  
  915.         Restitution de la dernière allocation :
  916.  
  917.                 mov ah,DeAllocate_Memory
  918.                 Int_EOS
  919.  
  920.  
  921.         Chargement d'un fichier externe avec un handle:
  922.  
  923.                 mov ah,Load_External_File_Handle
  924.                 mov edx,offset File_name
  925.                 Int_EOS
  926.                 jc Error_File
  927.                 mov File_Buffer,eax
  928.                 mov Memory_Handle,edi
  929.  
  930.  
  931.         Restitution par handle :
  932.  
  933.                 mov ah,DeAllocate_Memory_Handle
  934.                 mov edi,[Memory_Handle]
  935.                 Int_EOS
  936.                 jc Invalid_Handle
  937.  
  938.  
  939. La fonction Load_Internal_File fonctionne aussi si le programme n'est pas
  940. linké. L'E.O.S est capable de distinguer les deux cas ce qui permet de
  941. développer et tester un programme sans avoir à linker les données.
  942. De plus, si votre fichier est compacté avec un format de type LZ comme
  943. Diet 1.44 l'E.O.S le décompresse automatiquement !
  944.  
  945.         Il est aussi possible de faire l'opération inverse :
  946.  
  947.                 mov ah,Write_External_File
  948.                 mov edx,O File_name
  949.                 mov esi,[Buffer]
  950.                 mov ecx,[Size_Buffer]
  951.                 Int_EOS
  952.                 jc Error_File
  953.  
  954.  
  955. ╔══════════════════════════════════════════════════════════════════════════╗
  956. ║                                                                          ║
  957. ║ Les fonctions pour la gestion de fichiers                                ║
  958. ║                                                                          ║
  959. ╚══════════════════════════════════════════════════════════════════════════╝
  960.  
  961. ┌─────────────────────────┐
  962. │Load Internal File       │
  963. │Load External File       │
  964. │Load Internal File Handle│
  965. │Load External File Handle│
  966. │Write External File      │
  967. └─────────────────────────┘
  968.  
  969. ┌──────────────────────────────────────────────────────────────────────────┐
  970. │Load Internal file   Load a file which is link with LLINK                 │
  971. │                     if the file is not present the program stop and      │
  972. │                     display a error message                              │
  973. │                                                                          │
  974. │In :                                                                      │
  975. │        AH = Load_Internal_File                                           │
  976. │       EDX = Offset of file name                                          │
  977. │                                                                          │
  978. │Out :                                                                     │
  979. │       EAX = Logical address of buffer (work with Data32_Sel)             │
  980. │       ECX = Number of bytes read                                         │
  981. │       ESI = Physical address of buffer (work with Flat_Data_Sel)         │
  982. │                                                                          │
  983. │Other Registers Change : None                                             │
  984. │                                                                          │
  985. │                                                                          │
  986. └──────────────────────────────────────────────────────────────────────────┘
  987.  
  988. Exemple :
  989.             mov ah,Load_Internal_File
  990.             mov edx,O File_name
  991.             Int_EOS
  992.             mov [File_Buffer],eax
  993.  
  994.  
  995. ┌──────────────────────────────────────────────────────────────────────────┐
  996. │Load External file   Load a external file and uncompress it if it has     │
  997. │                     been compress with Diet 1.44                         │
  998. │                                                                          │
  999. │In :                                                                      │
  1000. │        AH = Load_External_File                                           │
  1001. │       EDX = Offset of file name                                          │
  1002. │                                                                          │
  1003. │Out :                                                                     │
  1004. │       Carry = 0                                                          │
  1005. │        All done                                                          │
  1006. │       EAX = Logical address of buffer (work with Data32_Sel)             │
  1007. │       ECX = Number of bytes read                                         │
  1008. │       ESI = Physical address of buffer (work with Flat_Data_Sel)         │
  1009. │                                                                          │
  1010. │                                                                          │
  1011. │       Carry = 1                                                          │
  1012. │        Error                                                             │
  1013. │       EAX = 1 File Not Found                                             │
  1014. │             2 Not Enough Memory                                          │
  1015. │                                                                          │
  1016. │Other Registers Change : None                                             │
  1017. │                                                                          │
  1018. │                                                                          │
  1019. └──────────────────────────────────────────────────────────────────────────┘
  1020.  
  1021. Exemple :
  1022.             mov ah,Load_External_File
  1023.             mov edx,O File_name
  1024.             Int_EOS
  1025.             jc Error_File
  1026.             mov [File_Buffer],eax
  1027.  
  1028.  
  1029. ┌──────────────────────────────────────────────────────────────────────────┐
  1030. │Load Internal File Handle  Load a file which is link with LLINK           │
  1031. │                           if the file is not present the program stop    │
  1032. │                           and display a error message                    │
  1033. │                                                                          │
  1034. │In :                                                                      │
  1035. │        AH = Load_Internal_File_Handle                                    │
  1036. │       EDX = Offset of file name                                          │
  1037. │                                                                          │
  1038. │Out :                                                                     │
  1039. │       EAX = Logical address of buffer (work with Data32_Sel)             │
  1040. │       ECX = Number of bytes read                                         │
  1041. │       ESI = Physical address of buffer (work with Flat_Data_Sel)         │
  1042. │       EDI = Handle of Memory                                             │
  1043. │                                                                          │
  1044. │Other Registers Change : None                                             │
  1045. │                                                                          │
  1046. │                                                                          │
  1047. └──────────────────────────────────────────────────────────────────────────┘
  1048.  
  1049. Exemple :
  1050.             mov ah,Load_Internal_File_Handle
  1051.             mov edx,O File_name
  1052.             Int_EOS
  1053.             mov [File_Buffer],eax
  1054.             mov [Memory_Handle],edi
  1055.  
  1056.  
  1057. ┌──────────────────────────────────────────────────────────────────────────┐
  1058. │Load External File Handle  Load a external file and uncompress it if it   │
  1059. │                           has been compress with Diet 1.44               │
  1060. │                                                                          │
  1061. │In :                                                                      │
  1062. │        AH = Load_External_File_Handle                                    │
  1063. │       EDX = Offset of file name                                          │
  1064. │                                                                          │
  1065. │Out :                                                                     │
  1066. │       Carry = 0                                                          │
  1067. │        All done                                                          │
  1068. │       EAX = Logical address of buffer (work with Data32_Sel)             │
  1069. │       ECX = Number of bytes read                                         │
  1070. │       ESI = Physical address of buffer (work with Flat_Data_Sel)         │
  1071. │       EDI = Handle of Memory                                             │
  1072. │                                                                          │
  1073. │                                                                          │
  1074. │       Carry = 1                                                          │
  1075. │        Error                                                             │
  1076. │       EAX = 1 File Not Found                                             │
  1077. │             2 Not Enough Memory                                          │
  1078. │                                                                          │
  1079. │Other Registers Change : None                                             │
  1080. │                                                                          │
  1081. │                                                                          │
  1082. └──────────────────────────────────────────────────────────────────────────┘
  1083.  
  1084. Exemple :
  1085.             mov ah,Load_External_File_Handle
  1086.             mov edx,O File_name
  1087.             Int_EOS
  1088.             jc Error_File
  1089.             mov [File_Buffer],eax
  1090.             mov [Memory_Handle],edi
  1091.  
  1092.  
  1093. ┌──────────────────────────────────────────────────────────────────────────┐
  1094. │Write External File  Save a File on a Disk                                │
  1095. │                                                                          │
  1096. │Entree :                                                                  │
  1097. │        AH = Write_External_File                                          │
  1098. │       ECX = Size Of File                                                 │
  1099. │       EDX = Offset of file name                                          │
  1100. │       ESI = Buffer address                                               │
  1101. │                                                                          │
  1102. │Sortie :                                                                  │
  1103. │       Carry = 0                                                          │
  1104. │        Tout Va Bien                                                      │
  1105. │                                                                          │
  1106. │       Carry = 1                                                          │
  1107. │        Erreur  Can't write file                                          │
  1108. │                                                                          │
  1109. │Other Registers Change : None                                             │
  1110. │                                                                          │
  1111. │                                                                          │
  1112. └──────────────────────────────────────────────────────────────────────────┘
  1113.  
  1114. Exemple :
  1115.             mov ah,Write_External_File
  1116.             mov edx,O File_name
  1117.             mov esi,[Buffer]
  1118.             mov ecx,[Size_Buffer]
  1119.             Int_EOS
  1120.             jc Error_File
  1121.  
  1122.  
  1123. ╔══════════════════════════════════════════════════════════════════════════╗
  1124. ║                                                                          ║
  1125. ║ La gestion des cartes sonores                                            ║
  1126. ║                                                                          ║
  1127. ╚══════════════════════════════════════════════════════════════════════════╝
  1128.  
  1129. La gestion des cartes sonores n'a pas été oubliée.
  1130.  
  1131. L'E.O.S est en effet capable de jouer un sample ou un module Amiga (de 2 à 32
  1132. voix) sans la moindre programmation de votre part sur les neuf cartes
  1133. suivantes :
  1134.  
  1135.         ■ Sound Blaster
  1136.         ■ Sound Blaster Pro
  1137.         ■ Sound Blaster 16 Asp
  1138.         ■ Sound Blaster AW32
  1139.         ■ Gravis Ultrasound
  1140.         ■ Gravis Ultrasound Max
  1141.         ■ Gravis Ultrasound Ace
  1142.         ■ Gravis Ultrasound Pnp
  1143.         ■ Windows Sound System
  1144.  
  1145. Pour une qualité de mixage optimale, l'E.O.S choisit automatiquement le
  1146. mixage adapté à la carte sonore détectée (8bits pour la SB pro, 16 bits pour
  1147. la Sb 16, etc...).
  1148.  
  1149. Attention : La détection est réalisée à l'aide de la variable d'environnement
  1150. (Blaster ou Ultrasnd). Si cette variable n'est pas correctement renseignée
  1151. aucune carte sonore ne sera détectée.
  1152.  
  1153.  
  1154.         Exemple :
  1155.  
  1156.                 mov ah,Detect_Sound_Card
  1157.                 xor bx,bx
  1158.                 mov cx,1
  1159.                 Int_EOS
  1160.  
  1161.                 Vous n'êtes pas obligé d'utiliser la détection automatique :
  1162.  
  1163.                 mov ah,Manual_Setup
  1164.                 mov al,Gravis
  1165.                 mov bx,220h
  1166.                 mov cl,7
  1167.                 mov ch,7
  1168.                 mov dl,1
  1169.                 mov dh,1
  1170.                 Int_EOS
  1171.  
  1172.                 Après avoir détecter une carte il faut charger un fichier de
  1173.                 musique en mémoire :
  1174.  
  1175.                 mov ah,Load_Module
  1176.                 mov al,4
  1177.                 mov ebx,22000
  1178.                 mov edx,offset Module_name
  1179.                 xor ecx,ecx
  1180.                 Int_EOS
  1181.                 jc error_file
  1182.  
  1183.                 Pour finir il faut lancer la musique :
  1184.  
  1185.                 mov ah,Play_Module
  1186.                 Int_EOS
  1187.  
  1188.                 Plusieurs fonctions sont alors disponibles :
  1189.  
  1190.                         Set Volume   Pour changer le volume de la musique
  1191.                         Play Sample  Pour jouer un sample
  1192.                         Get Info     Pour obtenir des infos sur la musique
  1193.                                      (synchronisation par exemple)
  1194.                         Set Pattern  Pour changer de position dans un module
  1195.  
  1196.                 call Pause
  1197.  
  1198.                 mov ax,4c00h
  1199.                 int 21h
  1200.  
  1201. Comme vous le voyez ci-dessus, vous n'êtes pas obligé d'arrêter la musique
  1202. ou de libérer la mémoire avant de quitter votre programme. C'est l'E.O.S qui
  1203. s'en charge. A chaque fois qu'il rencontre la fonction 4c00h ou lors
  1204. d'un plantage programme, l'E.O.S restitue automatiquement
  1205. l'environnement de départ :
  1206.  
  1207.         ■ Le mode vidéo y compris les modes VESA (132x60,etc...)
  1208.         ■ L'heure de l'horloge.
  1209.         ■ Les interruptions.
  1210.         ■ La mémoire allouée.
  1211.         ■ Stoppe la musique.
  1212.  
  1213. Bien entendu, il est toujours possible de libérer la mémoire et d'arrêter
  1214. un module pour en charger un autre comme ci-dessous:
  1215.  
  1216.                 mov ah,Stop_Module
  1217.                 Int_EOS
  1218.  
  1219.                 mov ah,Clear_Module
  1220.                 Int_EOS
  1221.  
  1222.  
  1223. ╔══════════════════════════════════════════════════════════════════════════╗
  1224. ║                                                                          ║
  1225. ║ Comment accéder aux différentes variables d'un module                    ║
  1226. ║                                                                          ║
  1227. ╚══════════════════════════════════════════════════════════════════════════╝
  1228.  
  1229. Pour accéder aux informations d'un module, vous pouvez utiliser la fonction
  1230. Get_Info ou accéder directement aux variables ci-dessous :
  1231.  
  1232. Sound_Card_Type                 : Byte
  1233. Sound_Card_Port                 : Word
  1234. Sound_Card_Irq                  : Byte
  1235. Sound_Card_Dma                  : Byte
  1236. Master_Volume                   : Byte
  1237. Master_Volume_Sfx               : Byte
  1238. Current_Pattern                 : Byte
  1239. Current_Note                    : Byte
  1240. Current_Speed                   : Byte
  1241. Current_BPM                     : Byte
  1242. Index_Pattern_Order             : Dword
  1243. Pattern_Order                   : Byte
  1244. Number_Channel                  : Dword
  1245. Diamond_Channel                 : MS
  1246.  
  1247. MS                              struc
  1248.         Current_Sample          dd      0
  1249.         Porta                   dw      ?
  1250.         Tremelo                 db      ?
  1251.         Current_Position        dd      ?
  1252.         Current_Low_Position    dd      ?
  1253.         Jump_0e6                db      ?
  1254.         Compt_jump_0e6          db      ?
  1255.         Flags_0e6               db      ?
  1256.         Porta_Freq              dw      ?
  1257.         Porta_To                dw      ?
  1258.         Vibrato                 db      ?
  1259.         Vibrato_Flag            db      ?
  1260.         FineTune                dw      ?
  1261.         Last_Effect             dd      0
  1262.         Voice                   db      ?
  1263.         Sample_volume           db      ?
  1264.         Base_Sample_Volume      db      ?
  1265.         Mute                    db      ?
  1266.         Frequence               dw      ?
  1267.         Compt_Frequence         dd      ?
  1268.         New_sample              db      ?
  1269.         Arp                     dw      ?,?,?
  1270.         Arp_Counter             dw      ?
  1271.         Slide_volume            dw      ?
  1272.         Panning                 db      ?
  1273.         Retrig_Note             db      ?
  1274.         Retrig_Note_Val         db      ?
  1275.         Cut_Note                db      ?
  1276.         Delay_Note              db      ?
  1277.                                 db      0
  1278.         Delay_Note_Offset       dd      ?
  1279.         Addr_Read_Again         dd      ?
  1280. MS                              ends
  1281.  
  1282.  
  1283. Exemple :
  1284.  
  1285.             mov [Master_Volume],32      ; Set Music Volume
  1286.             mov [Master_Volume_Sfx],63  ; Set Sample Volume
  1287.  
  1288.  
  1289. ╔══════════════════════════════════════════════════════════════════════════╗
  1290. ║                                                                          ║
  1291. ║ Absence de carte sonore                                                  ║
  1292. ║                                                                          ║
  1293. ╚══════════════════════════════════════════════════════════════════════════╝
  1294.  
  1295. L'E.O.S permet de jouer un module même en cas d'absence de carte
  1296. sonore. De ce fait, si certains évenements sont synchronisés par rapport à
  1297. la musique aucunes modifications n'est a apporter pour les machines sans
  1298. carte sonore.
  1299.  
  1300.  
  1301. ╔══════════════════════════════════════════════════════════════════════════╗
  1302. ║                                                                          ║
  1303. ║ Les déclarations du player de module                                     ║
  1304. ║                                                                          ║
  1305. ╚══════════════════════════════════════════════════════════════════════════╝
  1306.  
  1307.   No_Card    = 0
  1308.   Sb_10      = 01h
  1309.   Sb_15      = 02h
  1310.   Sb_20      = 03h
  1311.   Sb_Pro     = 04h
  1312.   Sb_16      = 05h
  1313.   Sb_Awe     = 06h
  1314.   Gravis     = 10h
  1315.   Gravis_Max = 11h
  1316.   Gravis_Ace = 12h
  1317.   Gravis_Pnp = 13h
  1318.   WSS        = 20h
  1319.  
  1320.  
  1321. ╔══════════════════════════════════════════════════════════════════════════╗
  1322. ║                                                                          ║
  1323. ║ Les effets sonores                                                       ║
  1324. ║                                                                          ║
  1325. ╚══════════════════════════════════════════════════════════════════════════╝
  1326.  
  1327. L'E.O.S est en mesure de jouer des samples indépendamment de la musique.
  1328. Pour cela il faut déclarer des pistes fictives lorsque l'on charge un module
  1329. en mémoire :
  1330.  
  1331. Exemple :
  1332.             mov ah,Load_Module
  1333.             mov al,4+1
  1334.             mov bx,22000
  1335.             mov ecx,1               ; Nombre de pistes pour les effets sonores
  1336.             mov edx,O Module_Name
  1337.             Int_EOS
  1338.             jc Error_Loading_Module
  1339.  
  1340.  
  1341. On peut ensuite jouer un sample à l'instant voulu très facilement :
  1342.  
  1343.             mov ah,Play_Sample
  1344.             mov cx,339              ; Freq.
  1345.             mov dx,00               ; Piste 1
  1346.             mov bx,09h              ; Sample number
  1347.             Int_EOS
  1348.  
  1349.  
  1350. ╔══════════════════════════════════════════════════════════════════════════╗
  1351. ║                                                                          ║
  1352. ║ Les fonctions pour jouer une musique ou des effets sonores               ║
  1353. ║                                                                          ║
  1354. ╚══════════════════════════════════════════════════════════════════════════╝
  1355.  
  1356. ┌─────────────────┐
  1357. │Detect Sound Card│
  1358. │Manual Setup     │
  1359. │Load Module      │
  1360. │Play Module      │
  1361. │Stop Module      │
  1362. │Clear Module     │
  1363. │Set Volume       │
  1364. │Play Sample      │
  1365. │Get Info         │
  1366. │Set Pattern      │
  1367. └─────────────────┘
  1368.  
  1369. ┌──────────────────────────────────────────────────────────────────────────┐
  1370. │Detect Sound Card   Detect with the environment variable the sound        │
  1371. │                    card installed                                        │
  1372. │                                                                          │
  1373. │In :                                                                      │
  1374. │        AH = Detect_Sound_Card                                            │
  1375. │        CX = 1  Display result of Searching                               │
  1376. │                                                                          │
  1377. │Out :                                                                     │
  1378. │        AX = 0  No_Card                                                   │
  1379. │           = 1  Sound Blaster 1.0                                         │
  1380. │           = 2  Sound Blaster 1.5                                         │
  1381. │           = 3  Sound Blaster 2.0                                         │
  1382. │           = 4  Sound Blaster Pro                                         │
  1383. │           = 5  Sound Blaster 16                                          │
  1384. │           = 6  Sound Blaster Awe 32                                      │
  1385. │           = 10h  Gus                                                     │
  1386. │           = 11h  Gus Max                                                 │
  1387. │           = 12h  Gus Ace                                                 │
  1388. │           = 13h  Gus Pnp                                                 │
  1389. │           = 20h  Windows Sound System                                    │
  1390. │        BX = Port                                                         │
  1391. │        CX = Irq                                                          │
  1392. │        DX = Dma                                                          │
  1393. │        SI = Dsp Version (For Sb) ou                                      │
  1394. │             Size of RAM of the Gravis                                    │
  1395. │                                                                          │
  1396. │Other Registers Change : None                                             │
  1397. │                                                                          │
  1398. │                                                                          │
  1399. └──────────────────────────────────────────────────────────────────────────┘
  1400.  
  1401. Exemple :
  1402.             mov ah,Detect_Sound_Card
  1403.             mov cx,1
  1404.             Int_EOS
  1405.  
  1406.  
  1407. ┌──────────────────────────────────────────────────────────────────────────┐
  1408. │Manual Setup                                                              │
  1409. │                                                                          │
  1410. │In :                                                                      │
  1411. │        AH = Manual_Setup                                                 │
  1412. │        AL = Type                                                         │
  1413. │        BX = Port                                                         │
  1414. │        CL = Irq1                                                         │
  1415. │        CH = Irq2      ; Irq Gus 2                                        │
  1416. │        DL = Dma1      ; Dma Gus 1 or Dma 8 Bits for SB                   │
  1417. │        DH = Dma2      ; Dma Gus 2 or Dma 16 Bits for SB                  │
  1418. │                                                                          │
  1419. │Out :                                                                     │
  1420. │        Carry Off                                                         │
  1421. │        Init Ok                                                           │
  1422. │                                                                          │
  1423. │        Carry On                                                          │
  1424. │        No Sound Card Found                                               │
  1425. │                                                                          │
  1426. └──────────────────────────────────────────────────────────────────────────┘
  1427. Manual_Setup        = 37h
  1428. If Impossible
  1429.             mov ah,Manual_Setup
  1430.             mov al,Gravis
  1431.             mov bx,220h
  1432.             mov cl,7
  1433.             mov ch,7
  1434.             mov dl,1
  1435.             mov dh,1
  1436.             Int_EOS
  1437.             ...
  1438.             mov ah,Manual_Setup
  1439.             mov al,Sb_16
  1440.             mov bx,220h
  1441.             mov cl,7
  1442.             mov dl,1
  1443.             mov dh,5
  1444.             Int_EOS
  1445. EndIf
  1446.  
  1447.  
  1448. ┌──────────────────────────────────────────────────────────────────────────┐
  1449. │Load Module   Load a module & initialize into the memory                  │
  1450. │                                                                          │
  1451. │In :                                                                      │
  1452. │        AH = Load_Module                                                  │
  1453. │        AL = Bit 0 = 1  Load a internal module (can be compress and link  │
  1454. │                        with LLINK)                                       │
  1455. │           = Bit 1 = 1  Load module  from memory                          │
  1456. │           = Bit 2 = 1  Force old mod Loading (15 instr)                  │
  1457. │        BX = Replay rate (16000 to 44100 Hz)                              │
  1458. │        CX = Number of Sfx Channel                                        │
  1459. │        DS:EDX = Offset of Module name or                                 │
  1460. │                 Offset into the memory of the beginning of the module    │
  1461. │                                                                          │
  1462. │Out :                                                                     │
  1463. │        Carry = 0                                                         │
  1464. │             All Done                                                     │
  1465. │                                                                          │
  1466. │        Carry = 1                                                         │
  1467. │             Can't Load Module                                            │
  1468. │                                                                          │
  1469. │Other Registers Change : None                                             │
  1470. │                                                                          │
  1471. │                                                                          │
  1472. └──────────────────────────────────────────────────────────────────────────┘
  1473.  
  1474. Exemple :
  1475.             mov ah,Load_Module
  1476.             mov al,4+1
  1477.             mov bx,22000
  1478.             xor ecx,ecx
  1479.             mov edx,O Module_Name
  1480.             Int_EOS
  1481.             jc Error_Loading_Module
  1482.  
  1483.  
  1484. ┌──────────────────────────────────────────────────────────────────────────┐
  1485. │Play Module   Start playing the module                                    │
  1486. │                                                                          │
  1487. │In :                                                                      │
  1488. │        AH = Play_Module                                                  │
  1489. │                                                                          │
  1490. │Out :                                                                     │
  1491. │        Carry = 0                                                         │
  1492. │             All Done                                                     │
  1493. │                                                                          │
  1494. │        Carry = 1                                                         │
  1495. │             Can't Play Module                                            │
  1496. │                                                                          │
  1497. │Other Registers Change : None                                             │
  1498. │                                                                          │
  1499. │                                                                          │
  1500. └──────────────────────────────────────────────────────────────────────────┘
  1501.  
  1502. Exemple :
  1503.             mov ah,Play_Module
  1504.             Int_EOS
  1505.  
  1506.  
  1507. ┌──────────────────────────────────────────────────────────────────────────┐
  1508. │Stop Module   Stop playing module                                         │
  1509. │                                                                          │
  1510. │In :                                                                      │
  1511. │        AH = Stop_Module                                                  │
  1512. │                                                                          │
  1513. │Out :                                                                     │
  1514. │                                                                          │
  1515. │Other Registers Change : None                                             │
  1516. │                                                                          │
  1517. │                                                                          │
  1518. └──────────────────────────────────────────────────────────────────────────┘
  1519.  
  1520. Exemple :
  1521.             mov ah,Stop_Module
  1522.             Int_EOS
  1523.  
  1524.  
  1525. ┌──────────────────────────────────────────────────────────────────────────┐
  1526. │Clear Module   Unload the module from memory                              │
  1527. │                                                                          │
  1528. │In :                                                                      │
  1529. │        AH = Clear_Module                                                 │
  1530. │                                                                          │
  1531. │Out :                                                                     │
  1532. │                                                                          │
  1533. │Other Registers Change : None                                             │
  1534. │                                                                          │
  1535. │                                                                          │
  1536. └──────────────────────────────────────────────────────────────────────────┘
  1537.  
  1538. Exemple :
  1539.             mov ah,Clear_Module
  1540.             Int_EOS
  1541.  
  1542.  
  1543. ┌──────────────────────────────────────────────────────────────────────────┐
  1544. │Set Volume   Set the master volume of the module                          │
  1545. │                                                                          │
  1546. │In :                                                                      │
  1547. │        AH = Set_Volume                                                   │
  1548. │        CL = Volume (0 to 63)                                             │
  1549. │        DL = Sfx Volume (0 to 63)                                         │
  1550. │                                                                          │
  1551. │Out :                                                                     │
  1552. │                                                                          │
  1553. │Other Registers Change : None                                             │
  1554. │                                                                          │
  1555. │                                                                          │
  1556. └──────────────────────────────────────────────────────────────────────────┘
  1557.  
  1558. Exemple :
  1559.             mov ah,Set_Volume
  1560.             mov cl,[New_Volume]
  1561.             mov dl,[New_Volume_Sfx]
  1562.             Int_EOS
  1563.  
  1564.  
  1565. ┌──────────────────────────────────────────────────────────────────────────┐
  1566. │Play Sample   Play a sample include into the module                       │
  1567. │                                                                          │
  1568. │In :                                                                      │
  1569. │        AH = Play_Sample                                                  │
  1570. │        BX = Sample numbers                                               │
  1571. │        CX = Sample Frequency                                             │
  1572. │        DX = voice of sample                                              │
  1573. │                                                                          │
  1574. │Out :                                                                     │
  1575. │                                                                          │
  1576. │Other Registers Change : None                                             │
  1577. │                                                                          │
  1578. │                                                                          │
  1579. └──────────────────────────────────────────────────────────────────────────┘
  1580.  
  1581. Exemple :
  1582.             mov ah,Play_Sample
  1583.             mov bx,10
  1584.             mov cx,15fh
  1585.             mov dx,4
  1586.             Int_EOS
  1587.  
  1588.  
  1589. ┌──────────────────────────────────────────────────────────────────────────┐
  1590. │Get Info   Get information about the module when playing                  │
  1591. │                                                                          │
  1592. │In:                                                                       │
  1593. │        AH = Get_Info                                                     │
  1594. │                                                                          │
  1595. │Out:                                                                      │
  1596. │        AH = Position                                                     │
  1597. │        AL = Pattern                                                      │
  1598. │        BX = Note                                                         │
  1599. │        CL = Master Volume                                                │
  1600. │        DL = Master Volume Sfx                                            │
  1601. │                                                                          │
  1602. │                                                                          │
  1603. │Other Registers Change : None                                             │
  1604. │                                                                          │
  1605. │                                                                          │
  1606. └──────────────────────────────────────────────────────────────────────────┘
  1607.  
  1608. Exemple :
  1609.             mov ah,Get_Info
  1610.             Int_EOS
  1611.  
  1612.  
  1613. ┌──────────────────────────────────────────────────────────────────────────┐
  1614. │Set Pattern  Set the current position of the playing module               │
  1615. │                                                                          │
  1616. │In:                                                                       │
  1617. │        AH = Set_Pattern                                                  │
  1618. │        BX = New_Position                                                 │
  1619. │        CX = New_Note                                                     │
  1620. │                                                                          │
  1621. │Out:                                                                      │
  1622. │                                                                          │
  1623. │Other Registers Change : None                                             │
  1624. │                                                                          │
  1625. │                                                                          │
  1626. └──────────────────────────────────────────────────────────────────────────┘
  1627.  
  1628. Exemple :
  1629.             mov ah,Set_Pattern
  1630.             mov bx,[New_Position]
  1631.             mov cx,[New_Note]
  1632.             Int_EOS
  1633.  
  1634.  
  1635. ╔══════════════════════════════════════════════════════════════════════════╗
  1636. ║                                                                          ║
  1637. ║ Gestion d'un second écran monochrome                                     ║
  1638. ║                                                                          ║
  1639. ╚══════════════════════════════════════════════════════════════════════════╝
  1640.  
  1641. Pour faciliter le debuggage de vos programmes, l'E.O.S fournit des
  1642. fonctions qui permettent de controler un deuxième écran via une carte
  1643. monochrome de type Hercule.
  1644.  
  1645. L'E.O.S détecte automatiquement votre écran. Cependant, si celui-ci n'était
  1646. pas reconnu, vous pouvez utiliser la séquence suivante :
  1647.  
  1648.                 mov ah,Set_Mono
  1649.                 mov bx,On
  1650.                 Int_EOS
  1651.  
  1652. Deux fonctions sont alors disponibles : l'affichage d'une chaîne de
  1653. caractère ASCII et l'affichage d'une valeur Hexadécimal.
  1654.  
  1655.         Afficher une Chaîne ASCII :
  1656.  
  1657.                 mov ah,Set_String_Mono
  1658.                 mov bx,Coordonee X
  1659.                 mov cx,Coordonee Y
  1660.                 mov edx,Offset Chaine_A_Afficher
  1661.                 Int_EOS
  1662.  
  1663.         Afficher une Valeur Hexadécimal :
  1664.  
  1665.                 mov ah,Set_Value_Mono
  1666.                 mov bx,Coordonee X
  1667.                 mov cx,Coordonee Y
  1668.                 mov edx,Valeur_A_Afficher
  1669.                 Int_EOS
  1670.  
  1671. Une macro est également disponible : Send qui permet une utilisation
  1672. plus simple de la fonction Set_Value_Mono
  1673.  
  1674.         Afficher une Valeur sur l'écran monochrome :
  1675.  
  1676.                 Send Valeur_A_Afficher,X,Y
  1677.  
  1678. La chaîne ASCII peut se terminer soit par $ soit par le caractère NULL.
  1679. La fonction prend aussi en compte les caractères retour chariot (13 et 10).
  1680. Les valeurs en hexadécimal ne doivent pas dépasser 32 Bits.
  1681.  
  1682. Attention : Pour un gain de temps aucun test n'est effectué au niveau des
  1683.             coordonnées de l'écran.
  1684.  
  1685. Note : L'écran Monochrome est automatiquement effacé au début et a la fin d'un
  1686.        programme.
  1687.  
  1688.  
  1689. ╔══════════════════════════════════════════════════════════════════════════╗
  1690. ║                                                                          ║
  1691. ║ Les fonctions pour utiliser un second écran pour le debuggage            ║
  1692. ║                                                                          ║
  1693. ╚══════════════════════════════════════════════════════════════════════════╝
  1694.  
  1695. ┌───────────────┐
  1696. │Set Mono       │
  1697. │Set String Mono│
  1698. │Set Value Mono │
  1699. └───────────────┘
  1700.  
  1701. ┌──────────────────────────────────────────────────────────────────────────┐
  1702. │Set Mono   Force On/Off the display of all the Monochrome Function        │
  1703. │                                                                          │
  1704. │In :                                                                      │
  1705. │        AH = Set_Mono                                                     │
  1706. │        BX = On  Force Monochrome Off                                     │
  1707. │             Off Force Monochrome On                                      │
  1708. │                                                                          │
  1709. │Out :                                                                     │
  1710. │                                                                          │
  1711. │Other Registers Change : None                                             │
  1712. │                                                                          │
  1713. │                                                                          │
  1714. └──────────────────────────────────────────────────────────────────────────┘
  1715.  
  1716. Exemple :
  1717.             mov ah,Set_Mono
  1718.             mov bx,On
  1719.             Int_EOS
  1720.  
  1721.  
  1722. ┌──────────────────────────────────────────────────────────────────────────┐
  1723. │Set String Mono   Display a string on the Monochrome adapter              │
  1724. │                                                                          │
  1725. │In :                                                                      │
  1726. │        AH = Set_String_Mono                                              │
  1727. │        BX = Coordonate  X                                                │
  1728. │        CX = Coordonate  Y                                                │
  1729. │       EDX = Address of text ending by $                                  │
  1730. │                                                                          │
  1731. │                                                                          │
  1732. │Out :                                                                     │
  1733. │                                                                          │
  1734. │Other Registers Change : None                                             │
  1735. │                                                                          │
  1736. │                                                                          │
  1737. └──────────────────────────────────────────────────────────────────────────┘
  1738.  
  1739. Exemple :
  1740.             mov ah,Set_String_Mono
  1741.             mov bx,1
  1742.             mov cx,10
  1743.             mov edx,offset text_mono
  1744.             Int_EOS
  1745.  
  1746.  
  1747. ┌──────────────────────────────────────────────────────────────────────────┐
  1748. │Set Value Mono   Display A Word in Hexadécimal on the Monochrome adapter  │
  1749. │                                                                          │
  1750. │In :                                                                      │
  1751. │        AH = Set_Value_Mono                                               │
  1752. │        BX = Coordonate X                                                 │
  1753. │        CX = Coordonate Y                                                 │
  1754. │        EDX = Value to be display                                         │
  1755. │                                                                          │
  1756. │                                                                          │
  1757. │Out :                                                                     │
  1758. │                                                                          │
  1759. │Other Registers Change : None                                             │
  1760. │                                                                          │
  1761. │                                                                          │
  1762. └──────────────────────────────────────────────────────────────────────────┘
  1763.  
  1764. Exemple :
  1765.             mov ah,Set_Value_Mono
  1766.             mov bx,1
  1767.             mov cx,10
  1768.             mov dx,1234h
  1769.             Int_EOS
  1770.  
  1771.  
  1772. ╔══════════════════════════════════════════════════════════════════════════╗
  1773. ║                                                                          ║
  1774. ║ Le clavier                                                               ║
  1775. ║                                                                          ║
  1776. ╚══════════════════════════════════════════════════════════════════════════╝
  1777.  
  1778. Une gestion clavier très simple à été implantée dans l'E.O.S afin de vous
  1779. faciliter la vie. Pour l'activer il faut prendre le contrôle de l'interruption
  1780. 09 comme ci-dessous :
  1781.  
  1782.         Activation du gestionnaire de clavier
  1783.  
  1784.                 mov ah,Use_Int_09
  1785.                 mov bx,On
  1786.                 Int_EOS
  1787.  
  1788. Le clavier est alors entièrement gérer par l'E.O.S qui dialogue directement
  1789. avec lui. Il n'y a plus aucun appel vers les anciens gestionnaires du
  1790. DOS. L'interruption 16h ne fonctionne donc plus.
  1791.  
  1792. La lecture du clavier devient alors très facile grâce à la variable Key_Map.
  1793. Cette variable est en réalité un tableau de 128 octets qui correspond
  1794. au 128 scancodes renvoyés par le clavier.
  1795. Pour connaître l'état d'une touche il suffit de savoir si sont scancode et
  1796. à 0 ou 1 (On ou Off).
  1797.  
  1798.         Exemple, pour tester si la touche Escape est actuellement enfoncée :
  1799.  
  1800.                 cmp Key_Map[Escape],On
  1801.                 je Touche_Escape_Enfoncé
  1802.  
  1803.                 ...
  1804.  
  1805.         Touche_Escape_Enfoncé:
  1806.                 mov Key_Map[Escape],Off
  1807.  
  1808. Un scancode spécial "All" est utilisé pour savoir une touche a été enfoncée
  1809. puis relâchée.
  1810.  
  1811.         Exemple, pour tester si la touche Escape à été enfoncée :
  1812.  
  1813.                 cmp Key_Map[All],Escape
  1814.                 je Touche_Escape_Enfoncer
  1815.  
  1816. Ce qui permet d'attendre une touche quelconque :
  1817.  
  1818.         @@Attend_Touche:
  1819.                 cmp Key_Map[All],Off
  1820.                 je @@Attend_Touche
  1821.                 mov Key_Map[All],Off
  1822.  
  1823. Il est bien entendu possible de désactiver le clavier et de revenir à l'ancien
  1824. gestionnaire.
  1825.  
  1826.         Restauration du clavier :
  1827.  
  1828.                 mov ah,Use_Int_09
  1829.                 mov bx,Off
  1830.                 Int_EOS
  1831.  
  1832. Note : A la fin du programme, l'E.O.S restitue toutes les interruptions la
  1833.        restauration de l'interruption 09 n'est donc pas obligatoire.
  1834.  
  1835.  
  1836. ┌──────────────────────────────────────────────────────────────────────────┐
  1837. │Use Int 09   Use Internal Keyboard handler to use keyboard                │
  1838. │                                                                          │
  1839. │In :                                                                      │
  1840. │        AH = Use_Int_09                                                   │
  1841. │        BX = On Enable Int 09                                             │
  1842. │           = Off Disable Int 09 (Default setting)                         │
  1843. │                                                                          │
  1844. │                                                                          │
  1845. │Out :                                                                     │
  1846. │                                                                          │
  1847. │                                                                          │
  1848. │Other Registers Change : None                                             │
  1849. │                                                                          │
  1850. │                                                                          │
  1851. └──────────────────────────────────────────────────────────────────────────┘
  1852.  
  1853. Exemple :
  1854.             mov ah,Use_Int_09
  1855.             mov bx,On
  1856.             Int_EOS
  1857.  
  1858.             ...
  1859.  
  1860. @@Pause:                            ; Test if key pressed
  1861.             cmp Key_Map[All],Off
  1862.             je @@Pause
  1863.             mov Key_Map[All],Off
  1864.  
  1865.             ...
  1866.  
  1867. @@Pause:                            ; Test if the Esc key is pressed
  1868.             cmp Key_Map[Escape],On  ; Actually
  1869.             jne @@Pause
  1870.  
  1871.             ...
  1872.  
  1873. @@Pause:                            ; Test if the ESC key have been pressed
  1874.             cmp Key_Map[All],Escape
  1875.             jne @@Pause
  1876.  
  1877.  
  1878. ──────────────────────────────────────────────────────────────────────────────
  1879. Les déclarations pour Key_Map (Azerty)
  1880. ──────────────────────────────────────────────────────────────────────────────
  1881.  
  1882.             All
  1883.             Escape
  1884.             Return
  1885.             Alt
  1886.             Space
  1887.             Left
  1888.             Right
  1889.             Up
  1890.             Down
  1891.             Plus
  1892.             Moins
  1893.             Ctrl
  1894.             Num_0  à Num_9
  1895.             Key_0  à Key_9
  1896.             Key_A  à Key_Z
  1897.             Key_F1 à Key_F12
  1898.  
  1899.  
  1900. ╔══════════════════════════════════════════════════════════════════════════╗
  1901. ║                                                                          ║
  1902. ║ Synchronisation avec le balayage                                         ║
  1903. ║                                                                          ║
  1904. ╚══════════════════════════════════════════════════════════════════════════╝
  1905.  
  1906. L'E.O.S possède son propre système de synchronisation.
  1907.  
  1908.         Contrôle du retracage de l'écran :
  1909.  
  1910.                 mov ah,Wait_Vbl
  1911.                 Int_EOS
  1912.  
  1913. L'utilisation de l'interruption 08 ou timer permet d'augmenter les capacités
  1914. de cette fonction. Comme pour l'interruption clavier il n'y a pas d'appel vers
  1915. les anciens gestionnaires.
  1916.  
  1917.         Activation du gestionnaire de synchronisation :
  1918.  
  1919.                 mov ah,Use_Int_08
  1920.                 mov bx,On
  1921.                 Int_EOS
  1922.  
  1923. Attention : Lorsque vous utilisez Diamond, la fonction Use_Int_08 est
  1924. automatiquement activée. Dans ce cas la, Use_Int_08 ne sert à rien.
  1925.  
  1926. En retour, Wait_Vbl renvoie alors le nombre de balayage effectué depuis le
  1927. dernier appel. Cette fonction renvoie toujours 1 si l'interruption 08 est Off.
  1928.  
  1929.                 mov ah,Wait_Vbl
  1930.                 Int_EOS
  1931.                 mov [Nbs_Vbl],eax
  1932.  
  1933. Grâce à l'utilisation de cette interruption et à la fonction Wait_Vbl votre
  1934. programme est toujours capable de savoir combien de frame il a perdu. On
  1935. dispose ainsi d'un compteur régulier très pratique pour le calcul des
  1936. déplacements.
  1937.  
  1938. La fonction, Change_Synchro_Int_08 permet de changer la fréquence de balayage
  1939. pour le timer qui est de 70hz par défaut :
  1940.  
  1941.                 mov bx,60               ; 60Hz
  1942.                 mov ah,Change_Synchro_Int_08
  1943.                 Int_EOS
  1944.  
  1945. Une macro est aussi disponible : Colors qui permet de changer une couleur
  1946. temporairement pour décomposer chaque routine de votre programme.
  1947.  
  1948.         Fonction Colors:
  1949.  
  1950.                 colors Numero_de_couleur,Valeur_Rouge,Valeur_Verte,Valeur_bleue
  1951.  
  1952.  
  1953.         Exemple d'utilisation des fonctions de balayage :
  1954.  
  1955.         @@Boucle:
  1956.                 colors 0,63,0,0     ; Première couleur en Rouge vif
  1957.                 call Procedure_1
  1958.                 colors 0,0,63,0     ; Deuxième couleur en Ver Vif
  1959.                 call Procedure_2
  1960.                 mov ah,Wait_Vbl
  1961.                 Int_EOS
  1962.         @@Compt:
  1963.                 add [Valeur_Reguliere],1
  1964.                 dec eax             ; On additionne des valeurs régulières
  1965.                 jne @@Compt
  1966.                 cmp [Key_Map+All],On
  1967.                 jne @@Boucle
  1968.  
  1969.  
  1970. ╔══════════════════════════════════════════════════════════════════════════╗
  1971. ║                                                                          ║
  1972. ║ Les fonctions de synchronisations                                        ║
  1973. ║                                                                          ║
  1974. ╚══════════════════════════════════════════════════════════════════════════╝
  1975.  
  1976. ┌─────────────────────┐
  1977. │Wait Vbl             │
  1978. │Use Int 08           │
  1979. │Change Synchro Int 08│
  1980. └─────────────────────┘
  1981.  
  1982. ┌──────────────────────────────────────────────────────────────────────────┐
  1983. │Wait Vbl   Wait the vertical retrace                                      │
  1984. │                                                                          │
  1985. │In :                                                                      │
  1986. │                                                                          │
  1987. │Out :                                                                     │
  1988. │       EAX = Number of Vbl lost since the last call                       │
  1989. │             (work only when the Int 08 is on)                            │
  1990. │                                                                          │
  1991. │Other Registers Change : None                                             │
  1992. │                                                                          │
  1993. │                                                                          │
  1994. └──────────────────────────────────────────────────────────────────────────┘
  1995.  
  1996. Exemple :
  1997.             mov ah,Wait_Vbl
  1998.             Int_EOS
  1999.  
  2000.  
  2001. ┌──────────────────────────────────────────────────────────────────────────┐
  2002. │Use Int 08   Use Int 08 (IRQ 0) to count frame rate and have a stable     │
  2003. │             vertical retrace                                             │
  2004. │             Defaults frequency is 70Hz                                   │
  2005. │                                                                          │
  2006. │In :                                                                      │
  2007. │        AH = Use_Int_08                                                   │
  2008. │        BX = On Enable Int 08                                             │
  2009. │           = Off Disable Int 08                                           │
  2010. │                                                                          │
  2011. │                                                                          │
  2012. │Out :                                                                     │
  2013. │                                                                          │
  2014. │                                                                          │
  2015. │Other Registers Change : None                                             │
  2016. │                                                                          │
  2017. │                                                                          │
  2018. └──────────────────────────────────────────────────────────────────────────┘
  2019.  
  2020. Exemple :
  2021.             mov ah,Use_Int_08
  2022.             mov bx,On
  2023.             Int_EOS
  2024.  
  2025.  
  2026. ┌──────────────────────────────────────────────────────────────────────────┐
  2027. │Change Synchro Int 08   Change frequency for Interupt 08                  │
  2028. │                        Defaults frequency is 70Hz                        │
  2029. │                                                                          │
  2030. │In :                                                                      │
  2031. │        BX = frequency                                                    │
  2032. │        AH = Change_Synchro_Int_08                                        │
  2033. │                                                                          │
  2034. │Out :                                                                     │
  2035. │                                                                          │
  2036. │                                                                          │
  2037. │Other Registers Change : None                                             │
  2038. │                                                                          │
  2039. │                                                                          │
  2040. └──────────────────────────────────────────────────────────────────────────┘
  2041.  
  2042. Exemple :
  2043.             mov bx,70                   ; 70hz
  2044.             mov ah,Change_Synchro_Int_08
  2045.             Int_EOS
  2046.  
  2047.  
  2048. ╔══════════════════════════════════════════════════════════════════════════╗
  2049. ║                                                                          ║
  2050. ║ Les variables                                                            ║
  2051. ║                                                                          ║
  2052. ╚══════════════════════════════════════════════════════════════════════════╝
  2053.  
  2054. L'E.O.S possède quelques variables 'global' qui peuvent être nécessaires à
  2055. tout moment lors de l'exécution d'un programme :
  2056.  
  2057.  
  2058. ───────────────────────────────────────────────────────────────────────────────
  2059. Code32_Sel
  2060. ───────────────────────────────────────────────────────────────────────────────
  2061.  
  2062. Sélecteur de code (CS).
  2063.  
  2064.         Exemple : Détourner l'interruption 70h :
  2065.  
  2066.                 mov ah,Set_Int
  2067.                 mov bx,70h
  2068.                 mov cx,[Code32_Sel]         ; Sélecteur
  2069.                 mov edx,O New_Int_70h       ; Offset de la nouvelle routine
  2070.                 Int_EOS
  2071.  
  2072. Attention ! En mode protégé, il est interdit de faire :
  2073.  
  2074.                 mov cs:[Valeur],10
  2075.  
  2076. Cela déclencherait une exception et arrêterait votre programme.
  2077.  
  2078.  
  2079. ───────────────────────────────────────────────────────────────────────────────
  2080. Data32_Sel
  2081. ───────────────────────────────────────────────────────────────────────────────
  2082.  
  2083. Sélecteur de Données (DS).
  2084.  
  2085.         Exemple d'utilisation de Data32_Sel :
  2086.  
  2087.                 Valeur  dd 0
  2088.  
  2089.                 mov [Valeur],10
  2090.  
  2091. En fait, les sélecteurs Code32_Sel et Data32_Sel sont identiques.
  2092. La différence porte sur leur accès. Code32_Sel est en lecture alors
  2093. que Data32_Sel est en lecture et écriture.
  2094.  
  2095. Au début d'un programme tous les sélecteurs (sauf CS) sont initialisés avec la
  2096. valeur de Data32_Sel.
  2097.  
  2098. Attention : Sous WATCOM, le sélecteur ES pointe sur le PSP du programme.
  2099.  
  2100.  
  2101. ───────────────────────────────────────────────────────────────────────────────
  2102. Flat_Data_Sel, Flat_Code_Sel
  2103. ───────────────────────────────────────────────────────────────────────────────
  2104.  
  2105. Sélecteurs qui ont pour origine l'adresse zéro de la mémoire. Très utile pour
  2106. lire les variables du BIOS. Flat_Data_Sel est en lecture et écriture mais il
  2107. ne peut pas être utilisé pour exécuter du code tandis que Flat_Code_Sel est en
  2108. lecture seulement mais peut être utilisé pour exécuter du code.
  2109.  
  2110.         Lire le mode vidéo courant :
  2111.  
  2112.                 push es
  2113.                 mov es,cs:[Flat_Code_Sel]
  2114.                 mov al,es:[449h]            ; 40h:49h en mode réel
  2115.                 pop es
  2116.  
  2117.  
  2118.  
  2119. ───────────────────────────────────────────────────────────────────────────────
  2120. Sélecteur 40h
  2121. ───────────────────────────────────────────────────────────────────────────────
  2122.  
  2123. Sélecteurs qui permet d'accéder directement aux variables du BIOS :
  2124.  
  2125.         Lire le mode vidéo courant :
  2126.  
  2127.                 push es
  2128.                 mov ax,40h
  2129.                 mov es,ax
  2130.                 mov al,es:[49h]             ; 40h:49h en mode réel
  2131.                 pop es
  2132.  
  2133.  
  2134. ───────────────────────────────────────────────────────────────────────────────
  2135. Real_DS,Real_ES,Real_FS,Real_GS,Real_SS,Real_SP
  2136. ───────────────────────────────────────────────────────────────────────────────
  2137.  
  2138. Ces variables contiennent les futures valeurs des différents segments lors d'un
  2139. appel en mode réel (Voir Le mode Réel).
  2140.  
  2141.  
  2142. ───────────────────────────────────────────────────────────────────────────────
  2143. _0b0000h, _0b8000h, _0a0000h
  2144. ───────────────────────────────────────────────────────────────────────────────
  2145.  
  2146. Ces variables contiennent les différentes adresses 32 bits de la VRAM.
  2147.  
  2148.  
  2149. ╔══════════════════════════════════════════════════════════════════════════╗
  2150. ║                                                                          ║
  2151. ║ Les Macros                                                               ║
  2152. ║                                                                          ║
  2153. ╚══════════════════════════════════════════════════════════════════════════╝
  2154.  
  2155. L'E.O.S possède des macros qui permettent de simplifier la programmation.
  2156.  
  2157. ───────────────────────────────────────────────────────────────────────────────
  2158. Macro Colors
  2159. ───────────────────────────────────────────────────────────────────────────────
  2160.  
  2161.                 colors Numéro_de_couleur,Valeur_Rouge,Valeur_Verte,Valeur_bleu
  2162.  
  2163.         (Voir Synchronisation avec le balayage)
  2164.  
  2165.  
  2166. ───────────────────────────────────────────────────────────────────────────────
  2167. Macro Get_Param
  2168. ───────────────────────────────────────────────────────────────────────────────
  2169.  
  2170.                 Get_Param Param_Buffer
  2171.  
  2172.                 ...
  2173.  
  2174.                 Param_Buffer db 128 dup (0)
  2175.  
  2176.         Renvoie dans Param_Buffer les paramètres de la ligne de commande.
  2177.  
  2178.  
  2179. ───────────────────────────────────────────────────────────────────────────────
  2180. Macro Send
  2181. ───────────────────────────────────────────────────────────────────────────────
  2182.  
  2183.                 Send Valeur_A_Afficher,X,Y
  2184.  
  2185.         (Voir Gestion d'un second écran monochrome)
  2186.  
  2187.  
  2188. ───────────────────────────────────────────────────────────────────────────────
  2189. Macro DosInt
  2190. ───────────────────────────────────────────────────────────────────────────────
  2191.  
  2192.                 DosInt Numéro_d_interruption
  2193.  
  2194.         (Voir Le mode réel)
  2195.  
  2196.  
  2197. ───────────────────────────────────────────────────────────────────────────────
  2198. Macro DosCall
  2199. ───────────────────────────────────────────────────────────────────────────────
  2200.  
  2201.                 DosCall Adresse_Mode_réel
  2202.  
  2203.         (Voir Le mode réel)
  2204.  
  2205.  
  2206. ───────────────────────────────────────────────────────────────────────────────
  2207. Macro Init_es_di
  2208. ───────────────────────────────────────────────────────────────────────────────
  2209.  
  2210.                 Init_es_di Offset adresse_32_bits
  2211.  
  2212.         (Voir Le mode réel)
  2213.  
  2214.  
  2215. ───────────────────────────────────────────────────────────────────────────────
  2216. Macro Init_ds_dx
  2217. ───────────────────────────────────────────────────────────────────────────────
  2218.  
  2219.                 Init_ds_dx Offset adresse_32_bits
  2220.  
  2221.         (Voir Le mode réel)
  2222.  
  2223.  
  2224. ╔══════════════════════════════════════════════════════════════════════════╗
  2225. ║                                                                          ║
  2226. ║ Le mode réel                                                             ║
  2227. ║                                                                          ║
  2228. ╚══════════════════════════════════════════════════════════════════════════╝
  2229.  
  2230. Le mode réel est accessible à partir de l'E.O.S à l'aide de quatre macros et
  2231. de six variables :
  2232.  
  2233.         DosInt          macro Int_Number
  2234.         DosCALL         macro _Seg_,_Ofs_
  2235.         Init_es_di      macro Adrs
  2236.         Init_ds_dx      macro Adrs
  2237.  
  2238.         Real_GS         :dword
  2239.         Real_FS         :dword
  2240.         Real_DS         :dword
  2241.         Real_ES         :dword
  2242.         Real_SS         :dword
  2243.         Real_SP         :dword
  2244.  
  2245. En mode protégé, il n'y a plus de registres de segments mais des sélecteurs.
  2246. Les variables Real_xx contiennent par conséquent les valeurs des différents
  2247. segments lors d'un appel en mode réel. Si une interruption du DOS à besoin de
  2248. retourner un paramètre dans ES, celui-ci est retourné dans Real_ES. Real_ES
  2249. correspond donc au registre de segment ES du mode réel.
  2250.  
  2251.  
  2252.         Pour appeler une interruption (Int) du mode réel :
  2253.  
  2254.                 DosInt Numéro_d_interruption
  2255.  
  2256.         Exemple :
  2257.  
  2258.                 mov ax,13h                  ; Mode 320x200 256 Couleurs
  2259.                 DosInt 10h                  ; Appel de la fonction BIOS
  2260.                                             ; Set Video Mode
  2261.  
  2262.         Pour appeler une fonction (Call) en mode réel :
  2263.  
  2264.                 DosCall Adresse_Mode_réel
  2265.  
  2266.         Exemple :
  2267.  
  2268.                 XMS_Adresse dw 0,0
  2269.  
  2270.                 mov ax,4300h                ; Fonction qui teste si un
  2271.                 DosInt 2fh                  ; Driver XMS est présent
  2272.                 cmp al,80h
  2273.                 je No_XMS_Driver
  2274.                 mov ax,4310h                ; Si oui demande son point
  2275.                 DosInt 2fh                  ; d'entré
  2276.                 mov [XMS_Adresse],bx
  2277.                 mov eax,[Real_ES]
  2278.                 mov [XMS_Adresse+2],ax
  2279.                 xor ah,ah                   ; Fonction 0 du driver XMS
  2280.                 DosCall Dword Ptr [XMS_Adresse] ; Get XMS Version
  2281.  
  2282.  
  2283.         Pour initialiser les variables qui seront utilisées en mode réel :
  2284.  
  2285.                 Init_es_di Adresse_32bits
  2286.                 Init_ds_dx Adresse_32bits
  2287.  
  2288.         Exemple :
  2289.  
  2290.                 Vesa_Buffer db 256 dup (0)
  2291.  
  2292.                 Init_es_di Vesa_Buffer
  2293.                 mov ax,4f00h                ; Teste la présence d'un
  2294.                 DosInt 10h                  ; Driver VESA
  2295.  
  2296.                 cmp dword ptr Vesa_Buffer,'ASEV'
  2297.                 jne no_vesa
  2298.  
  2299.  
  2300. ╔══════════════════════════════════════════════════════════════════════════╗
  2301. ║                                                                          ║
  2302. ║ Les interruptions                                                        ║
  2303. ║                                                                          ║
  2304. ╚══════════════════════════════════════════════════════════════════════════╝
  2305.  
  2306. L'E.O.S permet de modifier les interruptions grâce aux fonctions Get_Int et
  2307. Set_Int.
  2308.  
  2309.         Exemple : Détourner l'interruption 70h :
  2310.  
  2311.                 mov ah,Get_Int              ; Lit L'ancien vecteur
  2312.                 mov bx,70h
  2313.                 Int_EOS
  2314.                 mov [Old_Selector_Int_70h],cx
  2315.                 mov [Old_Offset_Int_70h],edx
  2316.                 mov ah,Set_Int
  2317.                 mov bx,70h
  2318.                 mov cx,[Code32_Sel]         ; Sélecteur
  2319.                 mov edx,O New_Int_70h       ; Offset de la nouvelle routine
  2320.                 Int_EOS
  2321.  
  2322.  
  2323. L'E.O.S met aussi à la disposition du programmeur toute une série de fonctions
  2324. accessibles via l'interruption 21h.
  2325.  
  2326.  
  2327.         Exemple : Afficher un message :
  2328.  
  2329.                 Msg db 'Hello Word',13,10,36
  2330.  
  2331.                 mov ah,9                    ; Fonction Display String
  2332.                 mov edx,Offset Msg
  2333.                 int 21h
  2334.                 mov ax,4c00h
  2335.                 int 21h
  2336.  
  2337. Attention ! Pour terminer un programme il faut IMPERATIVEMENT appeler la
  2338.             fonction 4ch de l'interruption 21h
  2339.  
  2340.  
  2341. Tous les appels à des interruptions à partir du mode protégé sont
  2342. automatiquement transférés en mode réel :
  2343.  
  2344.                 xor ax,ax
  2345.                 int 33h
  2346.  
  2347.                 est équivalent à :
  2348.  
  2349.                 xor ax,ax
  2350.                 DosInt 33h
  2351.  
  2352.  
  2353. ╔══════════════════════════════════════════════════════════════════════════╗
  2354. ║                                                                          ║
  2355. ║ Les IRQ ou interruptions matérielles                                     ║
  2356. ║                                                                          ║
  2357. ╚══════════════════════════════════════════════════════════════════════════╝
  2358.  
  2359. Toutes les IRQs sont accessibles dans votre programme. Par contre L'E.O.S a
  2360. reprogammé ses interruptions pour éviter des conflits avec les exceptions du
  2361. mode protégé. Pour utiliser une IRQ l'E.O.S met deux fonctions à la
  2362. disposition du programmeur :
  2363.  
  2364.         Get_IRQ :
  2365.  
  2366.                 Fonction qui renvoie l'adresse d'une IRQ.
  2367.  
  2368.         Set_IRQ :
  2369.  
  2370.                 Fonction qui détourne une IRQ.
  2371.  
  2372.  
  2373.         Exemple d'utilisation :
  2374.  
  2375.         Old_IRQ0 Label Fword
  2376.         Old_Offset_IRQ0    dd 0
  2377.         Old_Selector_IRQ0  dw 0
  2378.  
  2379.                 mov ah,Get_IRQ
  2380.                 mov bl,0            ; IRQ timer
  2381.                 Int_EOS
  2382.                 mov [Old_Selector_IRQ0],cx
  2383.                 mov [Old_Offset_IRQ0],edx
  2384.                 mov ah,Set_IRQ
  2385.                 mov bl,0            ; IRQ timer
  2386.                 mov cx,cs
  2387.                 mov edx,Offset New_IRQ0
  2388.                 Int_EOS
  2389.                 ...
  2390.  
  2391.         New_IRQ0:
  2392.                 ...
  2393.                 jmp fword ptr cs:[Old_IRQ0]
  2394.  
  2395.  
  2396. Vous pouvez également utiliser les fonctions du mode réel :
  2397.  
  2398.                 mov ax,2508h        ; Détourner l'IRQ timer via Dos
  2399.                 init_ds_dx,Mon_Programme
  2400.                 int 21h
  2401.  
  2402.  
  2403. ╔══════════════════════════════════════════════════════════════════════════╗
  2404. ║                                                                          ║
  2405. ║ Les Exceptions                                                           ║
  2406. ║                                                                          ║
  2407. ╚══════════════════════════════════════════════════════════════════════════╝
  2408.  
  2409. ───────────────────────────────────────────────────────────────────────────────
  2410. Différence entre une exception et une intèrruption
  2411. ───────────────────────────────────────────────────────────────────────────────
  2412.  
  2413. Une exception est une interruption qui a la falculté de se déclencher à l'
  2414. intérieur d'une instruction. Par exemple :
  2415.  
  2416.         mov ecx,-1
  2417.         rep movsb       ; Une interruption doit attendre la fin du rep movsb
  2418.                           pour être prise en compte.
  2419.  
  2420.  
  2421. ───────────────────────────────────────────────────────────────────────────────
  2422. En cas de plantage
  2423. ───────────────────────────────────────────────────────────────────────────────
  2424.  
  2425. Toutes les exceptions sont gérées par l'E.O.S.
  2426.  
  2427. Lorsque l'une d'elle se déclenche, l'E.O.S arrête votre programme et restitue
  2428. automatiquement la mémoire allouée et le mode vidéo de départ.
  2429.  
  2430.  
  2431. ───────────────────────────────────────────────────────────────────────────────
  2432. Comment détourner une exception sous E.O.S.
  2433. ───────────────────────────────────────────────────────────────────────────────
  2434.  
  2435. Les exceptions sont gérées comme en DPMI. Elles possèdent une stucture en
  2436. entrée et un retf en sortie (voir doc du DPMI).
  2437.  
  2438.  
  2439. ╔══════════════════════════════════════════════════════════════════════════╗
  2440. ║                                                                          ║
  2441. ║ Les fonctions pour gérer les interruptions                               ║
  2442. ║                                                                          ║
  2443. ╚══════════════════════════════════════════════════════════════════════════╝
  2444.  
  2445. ┌───────┐
  2446. │Get Int│
  2447. │Set Int│
  2448. │Get Irq│
  2449. │Set Irq│
  2450. └───────┘
  2451.  
  2452. ┌──────────────────────────────────────────────────────────────────────────┐
  2453. │Get_Int       Get protected mode interrupt vector                         │
  2454. │                                                                          │
  2455. │In :                                                                      │
  2456. │        AH = Get_Int                                                      │
  2457. │        BX = Interrupt number                                             │
  2458. │                                                                          │
  2459. │Out :                                                                     │
  2460. │    CX:EDX = Selector:Offset of interrupt                                 │
  2461. │                                                                          │
  2462. │Autre Registre Modifie : Aucun                                            │
  2463. │                                                                          │
  2464. │                                                                          │
  2465. └──────────────────────────────────────────────────────────────────────────┘
  2466.  
  2467. Exemple :
  2468.             mov ah,Get_Int
  2469.             mov bx,10h
  2470.             Int_EOS
  2471.             mov [Old_Int_10_Selector],cx
  2472.             mov [Old_Int_10_Offset],edx
  2473.  
  2474.  
  2475. ┌──────────────────────────────────────────────────────────────────────────┐
  2476. │Set_Int       Set protected mode interrupt vector                         │
  2477. │                                                                          │
  2478. │In :                                                                      │
  2479. │        AH = Get_Int                                                      │
  2480. │        BX = Interrupt number                                             │
  2481. │    CX:EDX = Selector:Offset of interrupt                                 │
  2482. │                                                                          │
  2483. │Out :                                                                     │
  2484. │                                                                          │
  2485. │Autre Registre Modifie : Aucun                                            │
  2486. │                                                                          │
  2487. │                                                                          │
  2488. └──────────────────────────────────────────────────────────────────────────┘
  2489.  
  2490. Exemple :
  2491.             mov ah,Set_Int
  2492.             mov bx,10h
  2493.             mov cx,cs
  2494.             mov edx,O New_Int_10
  2495.             Int_EOS
  2496.  
  2497.  
  2498. ┌──────────────────────────────────────────────────────────────────────────┐
  2499. │Get_Irq       Get protected mode irq vector                               │
  2500. │                                                                          │
  2501. │In :                                                                      │
  2502. │        AH = Get_Irq                                                      │
  2503. │        BX = Irq number                                                   │
  2504. │                                                                          │
  2505. │Out :                                                                     │
  2506. │    CX:EDX = Selector:Offset of irq                                       │
  2507. │                                                                          │
  2508. │Autre Registre Modifie : Aucun                                            │
  2509. │                                                                          │
  2510. │                                                                          │
  2511. └──────────────────────────────────────────────────────────────────────────┘
  2512.  
  2513. Exemple :
  2514.             mov ah,Get_Irq
  2515.             mov bx,1h                               ; Keyboard
  2516.             Int_EOS
  2517.             mov [Old_Irq_01_Selector],cx
  2518.             mov [Old_Irq_01_Offset],edx
  2519.  
  2520.  
  2521. ┌──────────────────────────────────────────────────────────────────────────┐
  2522. │Set_Irq       Set protected mode irq vector                               │
  2523. │                                                                          │
  2524. │In :                                                                      │
  2525. │        AH = Get_Irq                                                      │
  2526. │        BX = Irq number                                                   │
  2527. │    CX:EDX = Selector:Offset of irq                                       │
  2528. │                                                                          │
  2529. │Out :                                                                     │
  2530. │                                                                          │
  2531. │Autre Registre Modifie : Aucun                                            │
  2532. │                                                                          │
  2533. │                                                                          │
  2534. └──────────────────────────────────────────────────────────────────────────┘
  2535.  
  2536. Exemple :
  2537.             mov ah,Set_Irq
  2538.             mov bx,1h                               ; Keyboard
  2539.             mov cx,cs
  2540.             mov edx,O New_Irq_01
  2541.             Int_EOS
  2542.  
  2543.  
  2544. ╔══════════════════════════════════════════════════════════════════════════╗
  2545. ║                                                                          ║
  2546. ║ Le linker                                                                ║
  2547. ║                                                                          ║
  2548. ╚══════════════════════════════════════════════════════════════════════════╝
  2549.  
  2550. L'E.O.S dispose d'un utilitaire (LLINK.EXE) qui permet de créer un seul
  2551. fichier exécutable à partir de plusieurs fichiers de données.
  2552.  
  2553.         programme.exe
  2554.         image.pcx        ---->   final.exe
  2555.         musique.mod
  2556.  
  2557. Une fois linké, les fichiers de données sont accessibles très facilement à
  2558. l'aide de la fonction Load_internal_File.
  2559.  
  2560.         Exemple d'utilisation de Load_Internal_File et de Load_External_File :
  2561.  
  2562.                 Fichier_Linker  db 'IMAGE.PIC',0
  2563.                 Fichier_Externe db 'PRG.CFG',0
  2564.  
  2565.                 mov ah,Load_Internal_File   ; Charge un fichier interne
  2566.                 mov edx,O Fichier_Linker
  2567.                 Int_EOS
  2568.  
  2569.                 Pas d'erreurs possibles car elles sont gérées par l'E.O.S.
  2570.  
  2571.  
  2572.                 mov ah,Load_External_File   ; Charge un fichier externe
  2573.                 mov edx,O Fichier_Externe
  2574.                 Int_EOS
  2575.                 jc Error_Loading
  2576.  
  2577.                 Gestion des erreurs par l'utilisateur.
  2578.  
  2579.  
  2580. Pour indiquer à LLINK la liste des fichiers à linker il suffit de créer un
  2581. fichier de lien comme ci-dessous.
  2582.  
  2583.         Contenu d'un fichier de lien (prg.eos) :
  2584.  
  2585.                 FINAL.EXE                   ; Nom de l'exécutable à créer
  2586.                 PRG.EXE                     ; Nom de l'exécutable à linker
  2587.                 IMAGE.PCX                   ; Fichier de données à linker
  2588.                 MUSIQUE.MOD                 ; Fichier de données à linker
  2589.                 :END                        ; Fin
  2590.  
  2591.         Linkage :
  2592.  
  2593.                 LLINK prg.eos
  2594.  
  2595. Afin de faciliter la programmation, il est possible d'utiliser la fonction
  2596. Load_Internal_File avec des fichiers externes, ce qui permet de linker un
  2597. programme lorsqu'il est entièrement terminé (Voir Example4).
  2598.  
  2599.  
  2600. ╔══════════════════════════════════════════════════════════════════════════╗
  2601. ║                                                                          ║
  2602. ║ Le Debugger 32 bits                                                      ║
  2603. ║                                                                          ║
  2604. ╚══════════════════════════════════════════════════════════════════════════╝
  2605.  
  2606. ───────────────────────────────────────────────────────────────────────────────
  2607. DEBUG.OBJ
  2608. ───────────────────────────────────────────────────────────────────────────────
  2609.  
  2610. Le debugger DEBUG.OBJ est un fichier objet externe qu'il vous suffit d'inclure
  2611. au moment du linkage :
  2612.  
  2613.         TLINK eos+mon_programme+debug /x /3
  2614.  
  2615.  
  2616. Pour l'appeler à partir de votre programme une fonction est mise à votre
  2617. disposition : DEBUG. Vous pouvez ainsi activer le debugger à
  2618. n'importe quel instant à l'aide d'un simple Call :
  2619.  
  2620. Exemple d'appel du debugger sous E.O.S.
  2621.  
  2622.         Locals
  2623.         .386
  2624.         CODE32 SEGMENT PUBLIC PARA 'CODE' USE32
  2625.         ASSUME  CS:CODE32,DS:CODE32,ES:CODE32
  2626.  
  2627.         INCLUDE ..\RESOURCE\EOS.INC
  2628.  
  2629.         Msg         db '    ■ Hello world...',13,10,36
  2630.  
  2631.         Start32:
  2632.  
  2633.             call debug              ; Where you want !!! Alt-x to exit
  2634.  
  2635.             mov ah,9
  2636.             mov edx,O Msg
  2637.             int 21h                 ; Call Display String
  2638.  
  2639.             mov ax,4c00h
  2640.             int 21h                 ; Exit with Error Code 0
  2641.  
  2642.         CODE32 ENDS
  2643.         END
  2644.  
  2645.  
  2646. Exemple d'appel du debugger sous WATCOM
  2647.  
  2648.         void main()
  2649.         {
  2650.         init_EOS();
  2651.         debug();
  2652.         printf("    ■ Hello world...\x0D\x0A");
  2653.         exit(0);
  2654.         }
  2655.  
  2656.  
  2657. Les fonctions du debugger sont les suivantes :
  2658.  
  2659. Pause       Break      Permet d'appeler le debugger à tout instant
  2660. Alt-X       Exit       Permet de quitter le debugger à tout instant
  2661. F1          Mono       Le debugger passe sur l'écran monochrome
  2662. F2          Color      Le debugger passe sur l'écran couleur
  2663. F3          Nop        Permet de placer des instructions NOP dans la fenêtre
  2664.                        de code
  2665. F4          Here       Permet d'aller à un point précis du programme
  2666. F5          Fpu        Remplace la fénètre Dump par les registres du
  2667.                        co-processeur
  2668. Alt-F5      UsrScr     Affiche l'écran vidéo du programme
  2669. F7          Next       Pour tracer à l'intérieur des procédures
  2670. Alt-F7      Int        Pour tracer à l'intérieur des interruptions
  2671. F8          Trace      Pour tracer sans rentrer dans les procédures
  2672. F9          Run        Pour rendre la main au programme
  2673. F10         BreakPoint Pour placer un point d'arrêt dans la fenêtre code
  2674. F11         Origin     Pour positionner la fenêtre code sur CS:EIP
  2675. F12         About      Pour connaître la version du debugger
  2676. Alt         Toggle     Remplace la fenêtre des registres par celle des
  2677.                        sélecteurs
  2678. Arrows      ScrollDump Scroll la fenêtre Code
  2679. Alt Arrows  ScrollCode Scroll la fenêtre Dump
  2680. Ctrl Arrows DecalCode  Décalage du désassemblage
  2681. Ctrl N      NewEIP     Permet de changer CS:EIP
  2682. Ctrl D      NewDump    Permet de changer l'adresse de la fenêtre Dump
  2683. Ctrl G      Goto       Permet d'aller à un point précis du programme
  2684. Ctrl H      Help       Affiche un écran d'aide
  2685.  
  2686. A chaque fois que le debugger rencontre une interruption de l'E.O.S, du DOS
  2687. ou du DPMI, celui indique en clair la fonction demandée.
  2688.  
  2689. Exemple :
  2690.             mov ah,9h
  2691.             int 21              = Display String
  2692.  
  2693.             mov ax,300h
  2694.             int 31h             = Simulate Real Mode Interrupt
  2695.  
  2696.             mov ah,47h
  2697.             Int_EOS             = Physical Address Mapping
  2698.  
  2699.  
  2700. Un utilitaire est aussi fourni pour configurer le debugger : EDCONFIG.EXE.
  2701. Pour plus d'infos taper EDCONFIG -h
  2702.  
  2703.  
  2704. ───────────────────────────────────────────────────────────────────────────────
  2705. WDEBUG.EXE
  2706. ───────────────────────────────────────────────────────────────────────────────
  2707.  
  2708. Vous pouvez aussi utiliser WDEBUG pour tracer des programmes au format LE.
  2709.  
  2710. Pour cela il faut extraire DOG4GW du programme EXE avec PMWBIND :
  2711.  
  2712.   PMWBIND /U fichier.EXE
  2713.  
  2714. Vous pouvez alors lancer le programme pour le debugger :
  2715.  
  2716.   WDEBUG fichier.LE
  2717.  
  2718. Pour appeler le debugger appuyez simplement sur la touche Pause.
  2719.  
  2720.  
  2721. ╔══════════════════════════════════════════════════════════════════════════╗
  2722. ║                                                                          ║
  2723. ║ Les fonctions du Debuggeur 32 bits                                       ║
  2724. ║                                                                          ║
  2725. ╚══════════════════════════════════════════════════════════════════════════╝
  2726.  
  2727. ┌───────────┐
  2728. │Debug      │
  2729. │Debug Back │
  2730. └───────────┘
  2731.  
  2732. ┌──────────────────────────────────────────────────────────────────────────┐
  2733. │Debug             Initialize and call the debugger                        │
  2734. │                                                                          │
  2735. │                                                                          │
  2736. │                                                                          │
  2737. │In :                                                                      │
  2738. │                                                                          │
  2739. │Out :                                                                     │
  2740. │                                                                          │
  2741. │Other Registers Change : None                                             │
  2742. │                                                                          │
  2743. └──────────────────────────────────────────────────────────────────────────┘
  2744.  
  2745. Exemple :
  2746.             call debug
  2747.  
  2748.  
  2749. ┌──────────────────────────────────────────────────────────────────────────┐
  2750. │Debug_Back        Initialize the debugger for Pause-key and Break_Point   │
  2751. │                                                                          │
  2752. │                                                                          │
  2753. │                                                                          │
  2754. │In :                                                                      │
  2755. │                                                                          │
  2756. │Out :                                                                     │
  2757. │                                                                          │
  2758. │Other Registers Change : None                                             │
  2759. │                                                                          │
  2760. └──────────────────────────────────────────────────────────────────────────┘
  2761.  
  2762. Exemple :
  2763.             call debug_Back
  2764.  
  2765.  
  2766. ╔══════════════════════════════════════════════════════════════════════════╗
  2767. ║                                                                          ║
  2768. ║ Appel du debugger par Break point                                        ║
  2769. ║                                                                          ║
  2770. ╚══════════════════════════════════════════════════════════════════════════╝
  2771.  
  2772. ┌───────────┐
  2773. │Break Point│
  2774. └───────────┘
  2775.  
  2776. ┌──────────────────────────────────────────────────────────────────────────┐
  2777. │Break_Point       call the debugger                                       │
  2778. │                                                                          │
  2779. │                                                                          │
  2780. │                                                                          │
  2781. │In :                                                                      │
  2782. │                                                                          │
  2783. │Out :                                                                     │
  2784. │                                                                          │
  2785. │Other Registers Change : None                                             │
  2786. │                                                                          │
  2787. └──────────────────────────────────────────────────────────────────────────┘
  2788.  
  2789. Exemple :
  2790.             Break_Point
  2791.  
  2792.  
  2793. ╔══════════════════════════════════════════════════════════════════════════╗
  2794. ║                                                                          ║
  2795. ║ Restitution automatique de l'environnement de départ                     ║
  2796. ║                                                                          ║
  2797. ╚══════════════════════════════════════════════════════════════════════════╝
  2798.  
  2799. Vous n'êtes pas obligé de libérer la mémoire avant de quitter votre
  2800. programme.  A chaque fois qu'il rencontre la fonction 4c00h ou lors d'un
  2801. plantage programme, l'E.O.S restitue automatiquement l'environnement de
  2802. départ :
  2803.  
  2804.                 ■ Le mode vidéo y compris les modes VESA (132x60,etc...)
  2805.                 ■ L'heure de l'horloge.
  2806.                 ■ Les interruptions.
  2807.                 ■ La mémoire allouée.
  2808.                 ■ Stoppe la musique.
  2809.  
  2810.  
  2811. Il est également possible de restituer à tout moment le mode vidéo de départ...
  2812.  
  2813.                 mov ah,Restore_Video_Mode
  2814.                 Int_EOS
  2815.  
  2816.  
  2817. Pour les erreurs, l'E.O.S dispose d'une sortie spécialisée qui permet d'afficher
  2818. un message d'erreur :
  2819.  
  2820.                 mov ah,Exit_Error
  2821.                 mov edx,Offset Error_Txt
  2822.                 Int_EOS
  2823.  
  2824.  
  2825. Cette fonction est identique à :
  2826.  
  2827.                 mov ah,9                    ; Fonction Display String
  2828.                 mov edx,Offset Msg
  2829.                 int 21h
  2830.                 mov ax,4c01h
  2831.                 int 21h
  2832.  
  2833.  
  2834. L'E.O.S vous permet également d'écrire directement en Ram vidéo et d'employer
  2835. des couleurs avec la fonction Direct_Send :
  2836.  
  2837.                 lea edx,Message
  2838.                 mov ah,Direct_Send
  2839.                 Int_EOS
  2840.  
  2841.                 ...
  2842.  
  2843. Message         db "    ",0,1,"■ Color Blue ",0,4,"Red ",13,10,0,0
  2844.  
  2845.  
  2846.  
  2847. ╔══════════════════════════════════════════════════════════════════════════╗
  2848. ║                                                                          ║
  2849. ║ Les Fonctions système                                                    ║
  2850. ║                                                                          ║
  2851. ╚══════════════════════════════════════════════════════════════════════════╝
  2852.  
  2853. ┌──────────────────────────────────────────────────────────────────────────┐
  2854. │Exit Error                                                                │
  2855. │Restore Video Mode                                                        │
  2856. │Detect Windows                                                            │
  2857. │Direct Send                                                               │
  2858. └──────────────────────────────────────────────────────────────────────────┘
  2859.  
  2860. ┌──────────────────────────────────────────────────────────────────────────┐
  2861. │Exit Error   Restore initial Video mode , interrupts , free all reserved  │
  2862. │             memory ,stop music if played and exit (with error code 1)    │
  2863. │             with a error message                                         │
  2864. │                                                                          │
  2865. │In :                                                                      │
  2866. │        AH = Exit_Error                                                   │
  2867. │    DS:EDX = Offset message to display                                    │
  2868. │                                                                          │
  2869. │Out :                                                                     │
  2870. │                                                                          │
  2871. │Other Registers Change : None                                             │
  2872. │                                                                          │
  2873. │                                                                          │
  2874. └──────────────────────────────────────────────────────────────────────────┘
  2875.  
  2876. Exemple :
  2877.             mov ah,Exit_Error
  2878.             mov edx,Offset Error_Txt
  2879.             Int_EOS
  2880.  
  2881.  
  2882. ┌──────────────────────────────────────────────────────────────────────────┐
  2883. │Restore Video Mode   Restore the inital video which is be active at the   │
  2884. │                     start of the program                                 │
  2885. │                                                                          │
  2886. │In :                                                                      │
  2887. │        AH = Restore_Video_Mode                                           │
  2888. │                                                                          │
  2889. │Out :                                                                     │
  2890. │                                                                          │
  2891. │Other Registers Change : None                                             │
  2892. │                                                                          │
  2893. │                                                                          │
  2894. └──────────────────────────────────────────────────────────────────────────┘
  2895.  
  2896. Exemple :
  2897.             mov ah,Restore_Video_Mode
  2898.             Int_EOS
  2899.  
  2900.  
  2901. ┌──────────────────────────────────────────────────────────────────────────┐
  2902. │Detect Windows       Detect If Windows is running                         │
  2903. │                                                                          │
  2904. │In :                                                                      │
  2905. │        AH = Detect_Windows                                               │
  2906. │                                                                          │
  2907. │Out :                                                                     │
  2908. │        AL = Windows version                                              │
  2909. │                                                                          │
  2910. │Other Registers Change : None                                             │
  2911. │                                                                          │
  2912. │                                                                          │
  2913. └──────────────────────────────────────────────────────────────────────────┘
  2914.  
  2915. Exemple :
  2916.  
  2917. Windows_3x          = 3
  2918. Windows_95          = 4
  2919.  
  2920.             lea edx,Windows_Txt
  2921.             mov ah,Detect_Windows
  2922.             Int_EOS
  2923.             or al,al
  2924.             jnz Error
  2925.  
  2926.             ...
  2927.  
  2928. Windows_Txt         db "    ■ Sorry, but this program can not run under Microsoft Windows (tm)",13,10,36
  2929.  
  2930.  
  2931. ┌──────────────────────────────────────────────────────────────────────────┐
  2932. │Direct Send          Write a text directly to video ram . Color allowed   │
  2933. │                                                                          │
  2934. │In :                                                                      │
  2935. │        AH = Direct_Send                                                  │
  2936. │       EDX = Offset message to Display                                    │
  2937. │                                                                          │
  2938. │Out :                                                                     │
  2939. │                                                                          │
  2940. │Other Registers Change : None                                             │
  2941. │                                                                          │
  2942. │Comand  : 0,0      = end                                                  │
  2943. │          0,1..255 = color                                                │
  2944. │          13       = first colonne                                        │
  2945. │          10       = next ligne                                           │
  2946. │                                                                          │
  2947. └──────────────────────────────────────────────────────────────────────────┘
  2948.  
  2949. Exemple :
  2950.  
  2951. Direct_Send         = 0Eh
  2952. If Impossible
  2953.             lea edx,Message
  2954.             mov ah,Direct_Send
  2955.             Int_EOS
  2956.  
  2957.             ...
  2958.  
  2959. Message             db "    ",0,1,"■ Color Blue ",0,4,"Red ",13,10,0,0
  2960.  
  2961.  
  2962. ╔══════════════════════════════════════════════════════════════════════════╗
  2963. ║                                                                          ║
  2964. ║ Comment développer une librairie compatible WATCOM C et E.O.S            ║
  2965. ║                                                                          ║
  2966. ╚══════════════════════════════════════════════════════════════════════════╝
  2967.  
  2968. Pour développer une librairie à la fois compatible avec WATCOM et E.O.S, vous
  2969. devez créer deux fichiers objets différents comme ci-dessous :
  2970.  
  2971.                 - <Nom>.obj    : VESA.OBJ   (E.O.S)
  2972.                 - W<Nom>.obj   : WVESA.OBJ  (WATCOM)
  2973.  
  2974.  
  2975. Pour cela, vous pouvez générer une variable de compilation dans
  2976. votre fichier makefile, par exemple __Use_Watcom__ :
  2977.  
  2978. PRG  = VESA
  2979. RES  = ..\RESOURCE
  2980.  
  2981. $(PRG).exe:       $(PRG).obj
  2982.         @Echo $(PRG) Has Been Assembled
  2983.  
  2984. $(PRG).obj: $(PRG).asm
  2985.         @tasm3 $(PRG) $(RES)\$(PRG) /m /q /p /d__Use_Watcom__=0
  2986.         @tasm3 $(PRG) $(RES)\W$(PRG) /m /q /p /d__Use_Watcom__=1
  2987.  
  2988.  
  2989. A partir de cette variable vous pouvez ensuite gérer deux codes
  2990. dans votre fichier source :
  2991.  
  2992.         If __Use_Watom__
  2993.           ...                   ; CODE Specifique à WATCON
  2994.           ...
  2995.         Else
  2996.           ...                   ; CODE Specifique à E.O.S
  2997.           ...
  2998.         EndIF
  2999.  
  3000.  
  3001. ╔══════════════════════════════════════════════════════════════════════════╗
  3002. ║                                                                          ║
  3003. ║ Différences entre un programme E.O.S et WATCOM                           ║
  3004. ║                                                                          ║
  3005. ╚══════════════════════════════════════════════════════════════════════════╝
  3006.  
  3007. ───────────────────────────────────────────────────────────────────────────────
  3008. La gestion mémoire sous WATCOM
  3009. ───────────────────────────────────────────────────────────────────────────────
  3010.  
  3011. Sous WATCOM, la mémoire est de type FLAT et commence à l'adresse 0.
  3012. Sous E.O.S, la mémoire est définit selon l'endroit ou le programme à éte
  3013. chargé.
  3014.  
  3015.  
  3016.          Pour allouer de la memoire sous E.O.S :
  3017.  
  3018.                 mov ah,Allocate_Memory_Handle
  3019.                 mov edx,Taille
  3020.                 Int_EOS
  3021.                 mov [Adresse_Memoire],edx
  3022.                 mov [Handle_Memoire],edi
  3023.  
  3024.  
  3025.          Pour allouer de la memoire sous WATCOM :
  3026.  
  3027.                 mov ah,Allocate_Memory_Handle
  3028.                 mov edx,Taille
  3029.                 Int_EOS
  3030.                 mov [Adresse_Memoire],eax
  3031.                 mov [Handle_Memoire],edi
  3032.  
  3033.  
  3034.          Example pour utiliser les deux :
  3035.  
  3036.                 mov ah,Allocate_Memory_Handle
  3037.                 mov edx,Taille
  3038.                 Int_EOS
  3039.         If __Use_Watom__
  3040.                 mov [Adresse_Memoire],eax
  3041.         Else
  3042.                 mov [Adresse_Memoire],edx
  3043.         Endif
  3044.                 mov [Handle_Memoire],edi
  3045.  
  3046.          !!! Idem pour Load_Internal_file et Load_External_File !!!
  3047.  
  3048.  
  3049. ───────────────────────────────────────────────────────────────────────────────
  3050. Les appels aux interruptions en mode REEL
  3051. ───────────────────────────────────────────────────────────────────────────────
  3052.  
  3053.          Sous E.O.S :
  3054.  
  3055.                 Init_es_edi Buffer_Vesa
  3056.                 mov ax,4f00h
  3057.                 DosInt 10h
  3058.  
  3059.  
  3060.          Sous WATCOM :
  3061.  
  3062.                On ne peut pas adresser directement les variables ni même
  3063.                utiliser les macros init_DS_DX, car le programme est chargé
  3064.                au-dessus du premier Mega octets et le DOS ne peut atteindre
  3065.                ces variables.
  3066.                Il est donc conseillé d'allouer de la mémoire avec la fonction
  3067.                48h de l'interruption 21h pour faire la passerelle avec le mode
  3068.                réel comme ci-dessous :
  3069.  
  3070.                 xor eax,eax
  3071.                 mov ah,48h
  3072.                 mov bx,256/16
  3073.                 int 21h
  3074.                 mov edi,O DPMI_CALL
  3075.                 mov W [edi.Real_mode_Call._EAX],4f00h
  3076.                 mov [edi.Real_mode_Call._EDI],0h
  3077.                 mov [edi.Real_mode_Call._ES],ax
  3078.                 mov ax,300h
  3079.                 mov bl,10h                      ; Int 10h
  3080.                 xor cx,cx
  3081.                 int 31h                         ; Simule une interruption
  3082.  
  3083.          La structure à utiliser pour les appels DPMI est la suivante :
  3084.  
  3085.                 Real_mode_Call STRUC
  3086.                 _EDI        dd ?
  3087.                 _ESI        dd ?
  3088.                 _EBP        dd ?
  3089.                             dd ?
  3090.                 _EBX        dd ?
  3091.                 _EDX        dd ?
  3092.                 _ECX        dd ?
  3093.                 _EAX        dd ?
  3094.                 _flags      dw ?
  3095.                 _ES         dw ?
  3096.                 _DS         dw ?
  3097.                 _FS         dw ?
  3098.                 _GS         dw ?
  3099.                 _IP         dw ?
  3100.                 _CS         dw ?
  3101.                 _SP         dw ?
  3102.                 _SS         dw ?
  3103.                             ends
  3104.  
  3105.                 DPMI_CALL   Real_mode_Call <>
  3106.  
  3107.  
  3108.          Pour faciliter la création de programme il serait plus judicieux
  3109.          d'allouer de la mémoire grâce aux fonctions DOS pour avoir très
  3110.          peu de différence entre les codes sources
  3111.  
  3112.          Exemple :
  3113.  
  3114.            If __Use_Watcom__
  3115.                             mov edi,O DPMI_CALL
  3116.                             mov W [edi.Real_mode_Call._EAX],4800h
  3117.                             mov W [edi.Real_mode_Call._EBX],512/16
  3118.                             mov ax,300h
  3119.                             mov bl,10h
  3120.                             xor cx,cx
  3121.                             int 31h
  3122.                             jc  Error_vesa
  3123.                             mov edi,O DPMI_CALL
  3124.                             movzx eax,W [edi.Real_mode_Call._EAX]
  3125.            Else
  3126.                             xor eax,eax
  3127.                             mov ah,48h
  3128.                             mov bx,512/16
  3129.                             Dosint 21h
  3130.                             jnz Error_vesa
  3131.            Endif
  3132.  
  3133. @@cont:
  3134.             mov [Seg_Buffer_Vesa],eax
  3135.             shl eax,4
  3136.             sub eax,[Code32_Addr]
  3137.             mov [Addr_Buffer_Vesa],eax
  3138.  
  3139.            If __Use_Watcom__
  3140.                             mov edi,O DPMI_CALL
  3141.                             mov W [edi.Real_mode_Call._EAX],4f00h
  3142.                             mov [edi.Real_mode_Call._EDI],0h
  3143.                             mov eax,[Seg_Buffer_Vesa]
  3144.                             mov [edi.Real_mode_Call._ES],ax
  3145.                             mov ax,300h
  3146.                             mov bl,10h
  3147.                             xor cx,cx
  3148.                             int 31h
  3149.                             jc  Error_vesa
  3150.            Else
  3151.                             mov eax,[Seg_Buffer_Vesa]
  3152.                             mov [Real_ES],eax
  3153.                             xor edi,edi
  3154.                             mov ax,4f00h
  3155.                             DosInt 10h
  3156.                             cmp ax,004fh
  3157.                             jne Error_vesa
  3158.            Endif
  3159.  
  3160.             mov edi,[Addr_Buffer_Vesa]
  3161.             cmp D [edi],'ASEV'
  3162.             jnz Error_vesa
  3163.  
  3164.  
  3165. ───────────────────────────────────────────────────────────────────────────────
  3166. Les variables inutilisables sous WATCOM
  3167. ───────────────────────────────────────────────────────────────────────────────
  3168.  
  3169.          Real_DS
  3170.          Real_ES
  3171.          Real_FS
  3172.          Real_GS
  3173.          Real_SS
  3174.          Real_SS
  3175.  
  3176.          pour les raisons indiquées plus haut
  3177.  
  3178.  
  3179. ───────────────────────────────────────────────────────────────────────────────
  3180. Différence entre les fichiers sources
  3181. ───────────────────────────────────────────────────────────────────────────────
  3182.  
  3183.       Sous E.O.S
  3184.  
  3185.          Dans un Programme E.O.S le début du programme doit obligatoirement
  3186.          s'appeler START32.
  3187.  
  3188.  
  3189.       Sous WATCOM
  3190.  
  3191.          Un programme peut commencer n'importe où, il suffit juste de préciser
  3192.          la fin du programme par la commande END <Label>.
  3193.  
  3194.          Il faut obligatoirement appeler la routine Init_EOS qui émule
  3195.          les variables de l'E.O.S le plus tôt possible dans le programme.
  3196.  
  3197.          Le sélecteur ES pointe sur le PSP du Programme.
  3198.  
  3199.  
  3200.      Exemple de programme WATCOM en assembleur :
  3201.  
  3202.         Locals
  3203.         .386
  3204.         CODE32 SEGMENT PUBLIC PARA 'CODE' USE32
  3205.         ASSUME  CS:CODE32,DS:CODE32,ES:CODE32
  3206.  
  3207.         INCLUDE ..\RESOURCE\EOS.INC
  3208.  
  3209.         Msg_Hello db 'Hello World ...',13,10,36
  3210.  
  3211.         Start32:
  3212.                 call Init_EOS
  3213.                 push ds
  3214.                 pop es
  3215.                 mov ah,9
  3216.                 mov edx,O Msg_Hello
  3217.                 int 21h
  3218.                 mov ax,4c00h
  3219.                 int 21h
  3220.  
  3221.         CODE32 ENDS
  3222.                END Start32
  3223.  
  3224.  
  3225.      Exemple de programme WATCOM en C :
  3226.  
  3227.         void main()
  3228.         {
  3229.                 call Init_EOS
  3230.                 printf("    ■ Hello world...\x0D\x0A");
  3231.                 exit(0);
  3232.         }
  3233.  
  3234.  
  3235. ╔══════════════════════════════════════════════════════════════════════════╗
  3236. ║                                                                          ║
  3237. ║ Les librairies de l'E.O.S                                                ║
  3238. ║                                                                          ║
  3239. ╚══════════════════════════════════════════════════════════════════════════╝
  3240.  
  3241. Contrairement aux fonctions de l'E.O.S, les appels aux fonctions des
  3242. librairies ne se font plus par l'interruption Int_EOS mais par de simple
  3243. Call.
  3244.  
  3245. Exemple :
  3246.             mov eax,Mode640x480x256
  3247.             call Init_Vesa
  3248.             jc Error_Vesa
  3249.  
  3250.  
  3251. Les fonctions disponibles sont les suivantes :
  3252.  
  3253.  
  3254. DEBUG.OBJ
  3255. ┌──────────────────────────────────────────────────────────────────────────┐
  3256. │Debug                                                                     │
  3257. │Debug Back                                                                │
  3258. └──────────────────────────────────────────────────────────────────────────┘
  3259.  
  3260. VESA.OBJ
  3261. ┌──────────────────────────────────────────────────────────────────────────┐
  3262. │Init Vesa                                                                 │
  3263. │Init Vesa2                                                                │
  3264. │Init Vesa Bank                                                            │
  3265. │Close Vesa Bank                                                           │
  3266. │Set Bank                                                                  │
  3267. └──────────────────────────────────────────────────────────────────────────┘
  3268.  
  3269. FLI32.OBJ
  3270. ┌──────────────────────────────────────────────────────────────────────────┐
  3271. │Load Fli                                                                  │
  3272. │Load Internal Fli                                                         │
  3273. │Dispose Fli                                                               │
  3274. │First Frame Fli                                                           │
  3275. │Next Frame Fli                                                            │
  3276. └──────────────────────────────────────────────────────────────────────────┘
  3277.  
  3278. SNAP.OBJ
  3279. ┌──────────────────────────────────────────────────────────────────────────┐
  3280. │Init Snap                                                                 │
  3281. │Snap IFF                                                                  │
  3282. │Save IFF                                                                  │
  3283. └──────────────────────────────────────────────────────────────────────────┘
  3284.  
  3285. JOYSTICK.OBJ
  3286. ┌──────────────────────────────────────────────────────────────────────────┐
  3287. │Init Joystick                                                             │
  3288. │Dectect Joystick                                                          │
  3289. │Add Joystick                                                              │
  3290. │Update Joystick                                                           │
  3291. │Sub Joystick                                                              │
  3292. │Upper Left                                                                │
  3293. │Lower Right                                                               │
  3294. │Center                                                                    │
  3295. └──────────────────────────────────────────────────────────────────────────┘
  3296.  
  3297. MEMORY.OBJ
  3298. ┌──────────────────────────────────────────────────────────────────────────┐
  3299. │Init Memory                                                               │
  3300. └──────────────────────────────────────────────────────────────────────────┘
  3301.  
  3302.  
  3303. ╔══════════════════════════════════════════════════════════════════════════╗
  3304. ║                                                                          ║
  3305. ║ La librairie VESA                                                        ║
  3306. ║                                                                          ║
  3307. ╚══════════════════════════════════════════════════════════════════════════╝
  3308.  
  3309. ───────────────────────────────────────────────────────────────────────────────
  3310. Automatic Bank Switching en VESA 1.0 ou 2.0
  3311. ───────────────────────────────────────────────────────────────────────────────
  3312.  
  3313. La librairie VESA permet de ne pas se soucier de la commutation des
  3314. banks en VESA 1.0. On peut écrire ou lire directement dans le buffer vidéo comme
  3315. ci-dessous :
  3316.  
  3317. Exemple :
  3318.  
  3319.             call Init_Vesa_Bank         ; Mise en place de la commutation
  3320.             jc Error_Sel                ; automatique des banks
  3321.  
  3322.             mov es,bx                   ; Positionnement de ES:EDI sur le
  3323.             xor edi,edi                 ; buffer vidéo
  3324.  
  3325.             mov esi,[Addr_Pic]          ; Positionnement de DE:ESI sur Addr_Pic
  3326.  
  3327.             xor edx,edx
  3328.             call Set_Bank               ; Sélection du premier bank
  3329.  
  3330.             mov ecx,640*(480/4)
  3331.             rep movsd                   ; Commutation auto des autres banks
  3332.  
  3333.  
  3334. Explication :
  3335.  
  3336. En principe, pour accéder à la totalité de la RAM vidéo, vous êtes obligé de
  3337. commuter manuellement les banks :
  3338.  
  3339.             mov esi,Adresse_de_mon_image
  3340.  
  3341.             mov edx,0
  3342.             call set_bank
  3343.             mov ecx,64k
  3344.             mov edi,0
  3345.             rep movsd
  3346.  
  3347.             mov edx,1
  3348.             call set_bank
  3349.             mov ecx,64k
  3350.             mov edi,0
  3351.             rep movsd
  3352.  
  3353.             etc..
  3354.  
  3355. Cette manipulation est possible avec l'E.O.S et très facile à réaliser pour
  3356. une image. Par contre pour des sprites qui se déplacent à l'écran cela
  3357. devient très vite plus difficile car le changement de bank peut survenir à
  3358. n'importe quel instant. A chaque pixel il faut donc faire un test ce qui
  3359. empêche l'utilisation d'instruction comme rep movsd. Inutile de vous dire
  3360. que c'est aussi très lent. Avec la commutation automatique de l'E.O.S,
  3361. il vous suffit d'indiquer le premier bank. Lorsqu'un changement de bank
  3362. doit avoir lieu, par exemple au milieu d'une instruction rep movsd l'E.O.S
  3363. commute le bank suivant et repositione le registre EDI et l'instruction
  3364. peut alors se poursuivre. Cette méthode est extrêmement rapide et permet
  3365. de travailler linéairement sans faire un seul test pour changer de bank.
  3366.  
  3367. Attention !
  3368.  
  3369. La valeur de EDI dans la routine suivante n'est pas égale
  3370. à 65535+4 mais à 00000+3.
  3371.  
  3372.             ...
  3373.             mov edi,65535
  3374.             stosd
  3375.             ...                 ; EDI = 3 !!!
  3376.  
  3377.  
  3378. Lorsque E.O.S change de bank, il change aussi la valeur de EDI :
  3379.  
  3380.             00000 Bank 1
  3381.             65535           ; edi=65535, bank= 1
  3382.             65536 Bank 2    ; edi=00000, bank= 2
  3383.  
  3384.  
  3385. Restrictions : En lecture, seul les instructions Lodsb, Lodsw et Lodsd
  3386. sont supportées.
  3387.  
  3388. Pour que le système de commutation fonctionne correctement, il faut donc
  3389. respecter les quatres règles suivantes :
  3390.  
  3391.             1 - Positionner manuellement le premier bank.
  3392.             2 - Ecrire dans le buffer vidéo de haut en bas.
  3393.             3 - Prendre en compte le fait que l'EOS peut modifier
  3394.                 EDI ou ESI.
  3395.             4 - Utiliser uniquement Lodsb, Lodsw et Lodsd pour lire dans
  3396.                 le buffer vidéo.
  3397.  
  3398.  
  3399. ───────────────────────────────────────────────────────────────────────────────
  3400. Linear Frame Buffer en VESA 2.0
  3401. ───────────────────────────────────────────────────────────────────────────────
  3402.  
  3403. En VESA 2.0, l'E.O.S permet d'accéder à un buffer linéaire fictif qui
  3404. correspond directement à la mémoire de votre carte graphique. Lorsque vous
  3405. écrivez dans ce buffer, l'information est instantanément écrite dans la ram de
  3406. la carte vidéo par un système de redirection d'adresse. Le buffer vidéo
  3407. fictif ne prend donc aucune place en mémoire RAM puisqu'il est l'image directe
  3408. de la mémoire vidéo.
  3409.  
  3410. Exemple :
  3411.  
  3412.             mov eax,Mode640x480x256 ; Init SVGA Mode
  3413.             mov ecx,640*480         ; Linear Buffer Size
  3414.             call Init_Vesa2
  3415.             jc Error_Vesa
  3416.             mov [Buffer],eax        ; Linear Buffer Address
  3417.  
  3418.             ...
  3419.  
  3420.             mov edi,[Buffer]
  3421.             mov ecx,(640/4)*480
  3422.             rep movsd
  3423.  
  3424.  
  3425. Cette méthode est beaucoup plus pratique que la commutation de
  3426. bank car les registres du processeur ne sont pas modifiés. Malheureusement,
  3427. ce système nécessite une carte vidéo très récente car le Linear Frame
  3428. Buffer est réalisé en hard par celle-ci.
  3429.  
  3430.  
  3431. ╔══════════════════════════════════════════════════════════════════════════╗
  3432. ║                                                                          ║
  3433. ║ Les fonctions de la librairie VESA                                       ║
  3434. ║                                                                          ║
  3435. ╚══════════════════════════════════════════════════════════════════════════╝
  3436.  
  3437. ┌───────────────┐
  3438. │Init Vesa      │
  3439. │Init Vesa2     │
  3440. │Init Vesa Bank │
  3441. │Close Vesa Bank│
  3442. │Set Bank       │
  3443. └───────────────┘
  3444.  
  3445. ┌──────────────────────────────────────────────────────────────────────────┐
  3446. │Init Vesa   Initialize A Vesa 1.x or 2.0 to use automatic bank switching  │
  3447. │                                                                          │
  3448. │In :                                                                      │
  3449. │        EAX = Vesa mode                                                   │
  3450. │                                                                          │
  3451. │Out :                                                                     │
  3452. │        EAX = VRAM address                                                │
  3453. │                                                                          │
  3454. │        Carry = 0                                                         │
  3455. │             All Done                                                     │
  3456. │                                                                          │
  3457. │        Carry = 1                                                         │
  3458. │             Mode Vesa not supported or Vesa driver not found             │
  3459. │                                                                          │
  3460. └──────────────────────────────────────────────────────────────────────────┘
  3461.  
  3462. Exemple :
  3463.             mov eax,Mode640x480x256
  3464.             call Init_Vesa
  3465.             jc Error_Vesa
  3466.  
  3467.             ...
  3468.  
  3469. Vesa_Txt            db '    ■ Mode SVGA not supported or VESA not found !',13,10
  3470.                     db '      To install a vesa driver, refer to your video card documentation.',13,10,36
  3471.  
  3472.  
  3473. ┌──────────────────────────────────────────────────────────────────────────┐
  3474. │Init Vesa2  Initialize A Vesa 2.0 to use linear frame buffer              │
  3475. │                                                                          │
  3476. │In :                                                                      │
  3477. │        EAX = Vesa mode                                                   │
  3478. │        ECX = Video buffer size                                           │
  3479. │                                                                          │
  3480. │Out :                                                                     │
  3481. │        EAX = Linear buffer address                                       │
  3482. │                                                                          │
  3483. │        Carry = 0                                                         │
  3484. │             All Done                                                     │
  3485. │                                                                          │
  3486. │        Carry = 1                                                         │
  3487. │             Mode Vesa not supported or Vesa driver not found             │
  3488. │                                                                          │
  3489. └──────────────────────────────────────────────────────────────────────────┘
  3490.  
  3491. Exemple :
  3492.             mov eax,Mode640x480x256
  3493.             mov ecx,640*480
  3494.             call Init_Vesa2
  3495.             jc Error_Vesa
  3496.             mov [Screen],eax
  3497.  
  3498.             ...
  3499.  
  3500. Vesa_Txt            db '    ■ Mode SVGA not supported or VESA not found !',13,10
  3501.                     db '      To install a vesa driver, refer to your video card documentation.',13,10,36
  3502.  
  3503.  
  3504. ┌──────────────────────────────────────────────────────────────────────────┐
  3505. │Init Vesa Bank   Init the Automatic Bank Switching                        │
  3506. │                                                                          │
  3507. │In :                                                                      │
  3508. │                                                                          │
  3509. │Out :                                                                     │
  3510. │        Carry = 0                                                         │
  3511. │             All Done                                                     │
  3512. │       BX = New selector for addressing the video ram                     │
  3513. │                                                                          │
  3514. │        Carry = 1                                                         │
  3515. │             Can't allocate selector                                      │
  3516. │                                                                          │
  3517. └──────────────────────────────────────────────────────────────────────────┘
  3518.  
  3519. Exemple :
  3520.             call Init_Vesa_Bank
  3521.             jc Error_Sel
  3522.             mov [screen_selector],bx
  3523.  
  3524.  
  3525. ┌──────────────────────────────────────────────────────────────────────────┐
  3526. │Close Vesa Bank  Close the Automatic Bank Switching                       │
  3527. │                                                                          │
  3528. │In :                                                                      │
  3529. │                                                                          │
  3530. │Out :                                                                     │
  3531. │                                                                          │
  3532. │                                                                          │
  3533. └──────────────────────────────────────────────────────────────────────────┘
  3534.  
  3535. Exemple :
  3536.             call Close_Vesa_Bank
  3537.  
  3538.  
  3539. ┌──────────────────────────────────────────────────────────────────────────┐
  3540. │Set Bank         Select the first Bank                                    │
  3541. │                                                                          │
  3542. │In :                                                                      │
  3543. │                                                                          │
  3544. │Out :                                                                     │
  3545. │                                                                          │
  3546. │                                                                          │
  3547. └──────────────────────────────────────────────────────────────────────────┘
  3548.  
  3549. Exemple :
  3550.             mov edx,edi     ; EDI Address of first pixel to be display
  3551.             shr edx,16
  3552.             call Set_Bank
  3553.             and edi,0ffffh
  3554.  
  3555.  
  3556. ╔══════════════════════════════════════════════════════════════════════════╗
  3557. ║                                                                          ║
  3558. ║ Les variables de la librairie VESA                                       ║
  3559. ║                                                                          ║
  3560. ╚══════════════════════════════════════════════════════════════════════════╝
  3561.  
  3562. ┌─────────────────────┐
  3563. │Vesa Clear Palette   │
  3564. └─────────────────────┘
  3565.  
  3566. ┌──────────────────────────────────────────────────────────────────────────┐
  3567. │Vesa Clear Palette   Toggle clear palette on/off                          │
  3568. │                                                                          │
  3569. │In :                                                                      │
  3570. │                                                                          │
  3571. │Out :                                                                     │
  3572. │                                                                          │
  3573. └──────────────────────────────────────────────────────────────────────────┘
  3574.  
  3575. Exemple :
  3576.             mov vesa_clear_palette,off  ; Default = On
  3577.             call Init_Vesa_Bank
  3578.             jc Error_Sel
  3579.             mov [screen_selector],bx
  3580.  
  3581.  
  3582. ╔══════════════════════════════════════════════════════════════════════════╗
  3583. ║                                                                          ║
  3584. ║ Les déclarations de la librairie VESA                                    ║
  3585. ║                                                                          ║
  3586. ╚══════════════════════════════════════════════════════════════════════════╝
  3587.  
  3588. ───────────────────────────────────────────────────────────────────────────────
  3589. VBE v1.0
  3590. ───────────────────────────────────────────────────────────────────────────────
  3591.  
  3592. Mode640x400x256             = 100h
  3593. Mode640x480x256             = 101h
  3594. Mode800x600x16              = 102h
  3595. Mode800x600x256             = 103h
  3596. Mode1024x768x16             = 104h
  3597. Mode1024x768x256            = 105h
  3598. Mode1280x1024x16            = 106h
  3599. Mode1280x1024x256           = 107h
  3600. Mode80x60                   = 108h
  3601. Mode132x25                  = 109h
  3602. Mode132x43                  = 10ah
  3603. Mode132x60                  = 10bh
  3604. Mode132x60                  = 10ch
  3605.  
  3606.  
  3607. ───────────────────────────────────────────────────────────────────────────────
  3608. VBE v1.2+
  3609. ───────────────────────────────────────────────────────────────────────────────
  3610.  
  3611. Mode320x200x32k             = 10dh
  3612. Mode320x200x64k             = 10eh
  3613. Mode320x200x16M             = 10fh
  3614. Mode640x480x32k             = 110h
  3615. Mode640x480x64k             = 111h
  3616. Mode640x480x16M             = 112h
  3617. Mode800x600x32k             = 113h
  3618. Mode800x600x64k             = 114h
  3619. Mode800x600x16M             = 115h
  3620. Mode1024x768x32k            = 116h
  3621. Mode1024x768x64k            = 117h
  3622. Mode1024x768x16M            = 118h
  3623. Mode1280x1024x32k           = 119h
  3624. Mode1280x1024x64k           = 11ah
  3625. Mode1280x1024x16M           = 11bh
  3626.  
  3627.  
  3628. ╔══════════════════════════════════════════════════════════════════════════╗
  3629. ║                                                                          ║
  3630. ║ La librairie FLI32                                                       ║
  3631. ║                                                                          ║
  3632. ╚══════════════════════════════════════════════════════════════════════════╝
  3633.  
  3634. Cette librairie permet d'utiliser des fichiers 3D précalculé au format FLI
  3635. ou FLC dans vos programmes.
  3636.  
  3637.  
  3638. ╔══════════════════════════════════════════════════════════════════════════╗
  3639. ║                                                                          ║
  3640. ║ Les fonctions de la librairie FLI32                                      ║
  3641. ║                                                                          ║
  3642. ╚══════════════════════════════════════════════════════════════════════════╝
  3643.  
  3644. ┌─────────────────┐
  3645. │Load Fli         │
  3646. │Load Internal Fli│
  3647. │First Frame Fli  │
  3648. │Next Frame Fli   │
  3649. │Dispose Fli      │
  3650. └─────────────────┘
  3651.  
  3652. ┌──────────────────────────────────────────────────────────────────────────┐
  3653. │Play a FLI/FLC files                                                      │
  3654. │                                                                          │
  3655. │Functions :                                                               │
  3656. │                                                                          │
  3657. │        Load_Fli          Load a FLI into the memory                      │
  3658. │                          Initialize if needed the track-disk mode        │
  3659. │                          Check the header                                │
  3660. │                                                                          │
  3661. │        Load_Internal_Fli Load a FLI which is link with LLINK             │
  3662. │                          Check the header                                │
  3663. │                                                                          │
  3664. │        First_Frame_Fli   Uncompress the first frame                      │
  3665. │                                                                          │
  3666. │        Next_Frame_Fli    Uncompress next frame                           │
  3667. │                                                                          │
  3668. │        Dispose_Fli       Freeing memory                                  │
  3669. │                          Close File                                      │
  3670. │                                                                          │
  3671. │Information During playing :                                              │
  3672. │                                                                          │
  3673. │        Fli_Err       = 1 - Chunk not found                               │
  3674. │                        2 - Out of memory                                 │
  3675. │                        3 - File error                                    │
  3676. │                        4 - Bad FLC header                                │
  3677. │                        5 - Size max for FLC : 640x480                    │
  3678. │                                                                          │
  3679. │        Fli_Swap      = On - Track disk running -  not enough memory to   │
  3680. │                             load the file                                │
  3681. │                        Off- File has been load into memory               │
  3682. │                                                                          │
  3683. │        Fli_Svga      = On - Number of Lines >200                         │
  3684. │                                                                          │
  3685. │        Fli_Delay     = Fli speed                                         │
  3686. │                                                                          │
  3687. │        Fli_Last_Frame= On - Last frame (Mode No looping)                 │
  3688. │                                                                          │
  3689. │        Fli_Current_Frame = Current frame                                 │
  3690. │                                                                          │
  3691. │Commands :                                                                │
  3692. │                                                                          │
  3693. │        Fli_Selector  = Screen selector                                   │
  3694. │                                                                          │
  3695. │        Fli_ReStart   = On - Restart at the begining of the animation     │
  3696. │                                                                          │
  3697. │        Fli_Loop      = On - Restart the FLI at the end (Defaults)        │
  3698. │                        Off- Stop at the end  (Mode No looping)           │
  3699. │                                                                          │
  3700. │        Fli_TrackDisk = On - Enable Track-Disk mode                       │
  3701. │                        Off- Track-Disk not use execpt when the FLI can't │
  3702. │                             be load into the memory                      │
  3703. │                                                                          │
  3704. │        Fli_Buffer    = Logical address of FLI buffer                     │
  3705. │                                                                          │
  3706. │        Fli_Ligne_Shl = 6 for  320 per line                               │
  3707. │                        7 for  640 per line                               │
  3708. │                                                                          │
  3709. │        Fli_Scr_X     = Number of pixel per line                          │
  3710. │        Fli_Scr_Y     = Number of lines                                   │
  3711. │                                                                          │
  3712. │        Fli_Decal_X   = Number of pixel per line                          │
  3713. │        Fli_Decal_Y   = Number of lines                                   │
  3714. │                                                                          │
  3715. └──────────────────────────────────────────────────────────────────────────┘
  3716.  
  3717. Exemple :
  3718.             mov edx, offset Fli_Path
  3719.             call Load_Fli
  3720.             jc Fli_Error
  3721.  
  3722.             cmp Fli_Svga,On
  3723.             je  @@Init_Svga
  3724.             jne @@Init_Vga
  3725.  
  3726.             ...
  3727.  
  3728.             mov Fli_Selector,[screen_selector]
  3729.  
  3730.             call First_Frame_Fli
  3731.             jc Fli_Error
  3732.  
  3733. @@again:
  3734.             mov ah,Wait_Vbl
  3735.             Int_EOS
  3736.  
  3737.             call Next_Frame_Fli
  3738.             jc Fli_Error
  3739.  
  3740.             cmp Key_Map[Escape],On
  3741.             jne @@again
  3742.  
  3743.  
  3744. ╔══════════════════════════════════════════════════════════════════════════╗
  3745. ║                                                                          ║
  3746. ║ La librairie SNAP                                                        ║
  3747. ║                                                                          ║
  3748. ╚══════════════════════════════════════════════════════════════════════════╝
  3749.  
  3750. Cette librairie permet de réaliser des hard-copy d'écran VESA au format IFF
  3751. à l'aide de la touche Arrêt_défil.
  3752.  
  3753.  
  3754. ╔══════════════════════════════════════════════════════════════════════════╗
  3755. ║                                                                          ║
  3756. ║ Les fonctions de la librairie SNAP                                       ║
  3757. ║                                                                          ║
  3758. ╚══════════════════════════════════════════════════════════════════════════╝
  3759.  
  3760. ┌─────────┐
  3761. │Init Snap│
  3762. │Snap IFF │
  3763. │Save IFF │
  3764. └─────────┘
  3765.  
  3766. ┌──────────────────────────────────────────────────────────────────────────┐
  3767. │Init Snap   Initialize the screen grabber . (You can change the int 09    │
  3768. │            function Use_Int_09 after this Init                           │
  3769. │                                                                          │
  3770. │In :                                                                      │
  3771. │                                                                          │
  3772. │Out :                                                                     │
  3773. │                                                                          │
  3774. └──────────────────────────────────────────────────────────────────────────┘
  3775.  
  3776. Exemple :
  3777.             mov ah,Use_Int_09
  3778.             mov bx,On
  3779.             Int_EOS
  3780.  
  3781.             call Init_Snap
  3782.  
  3783.  
  3784. ┌──────────────────────────────────────────────────────────────────────────┐
  3785. │Snap IFF    Grab the current Screen from Video RAM                        │
  3786. │                                                                          │
  3787. │In :                                                                      │
  3788. │                                                                          │
  3789. │Out :                                                                     │
  3790. │                                                                          │
  3791. └──────────────────────────────────────────────────────────────────────────┘
  3792.  
  3793. Exemple :
  3794.             call Snap_IFF
  3795.  
  3796.  
  3797. ┌──────────────────────────────────────────────────────────────────────────┐
  3798. │Save IFF    Save a buffer to IFF                                          │
  3799. │                                                                          │
  3800. │In :                                                                      │
  3801. │        AX = Screen Size X                                                │
  3802. │        BX = Screen Size Y                                                │
  3803. │       EDX = Offset of File Name                                          │
  3804. │       ESI = Address to save in IFF                                       │
  3805. │                                                                          │
  3806. │Out :                                                                     │
  3807. │                                                                          │
  3808. └──────────────────────────────────────────────────────────────────────────┘
  3809.  
  3810. Exemple :
  3811.             mov ax,640
  3812.             mov bx,480
  3813.             mov edx,O File_Name
  3814.             mov esi,Buffer
  3815.             call Save_IFF
  3816.  
  3817.  
  3818. ╔══════════════════════════════════════════════════════════════════════════╗
  3819. ║                                                                          ║
  3820. ║ La librairie JOYSTICK                                                    ║
  3821. ║                                                                          ║
  3822. ╚══════════════════════════════════════════════════════════════════════════╝
  3823.  
  3824. Cette librairie permet de gérer des manettes de jeux.
  3825.  
  3826.  
  3827. ╔══════════════════════════════════════════════════════════════════════════╗
  3828. ║                                                                          ║
  3829. ║ Les fonctions de la librairie JOYSTICK                                   ║
  3830. ║                                                                          ║
  3831. ╚══════════════════════════════════════════════════════════════════════════╝
  3832.  
  3833. ┌────────────────┐
  3834. │Init Joystick   │
  3835. │Dectect Joystick│
  3836. │Add Joystick    │
  3837. │Update Joystick │
  3838. │Sub Joystick    │
  3839. │Upper Left      │
  3840. │Lower Right     │
  3841. │Center          │
  3842. └────────────────┘
  3843.  
  3844. ┌──────────────────────────────────────────────────────────────────────────┐
  3845. │Init_Joystick  Initialize all port en address                             │
  3846. │                                                                          │
  3847. │In :                                                                      │
  3848. │                                                                          │
  3849. │Out :                                                                     │
  3850. │                                                                          │
  3851. │Other Registers Change : None                                             │
  3852. │                                                                          │
  3853. └──────────────────────────────────────────────────────────────────────────┘
  3854.  
  3855. Exemple :
  3856.             call Init_Joystick
  3857.  
  3858.  
  3859. ┌──────────────────────────────────────────────────────────────────────────┐
  3860. │Dectect_Joystick  Find if a analogic joystick is plug in port 1 ,2 or Both│
  3861. │                                                                          │
  3862. │In :                                                                      │
  3863. │                                                                          │
  3864. │Out :                                                                     │
  3865. │        Carry = 0                                                         │
  3866. │             All Done                                                     │
  3867. │       EAX = 1 A joystick is plug in port 1                               │
  3868. │             2 A joystick is plug in port 2                               │
  3869. │             3 2 joystick is plug in port 1 and 2                         │
  3870. │                                                                          │
  3871. │        Carry = 1                                                         │
  3872. │             No Joystick                                                  │
  3873. │                                                                          │
  3874. │Other Registers Change : None                                             │
  3875. │                                                                          │
  3876. └──────────────────────────────────────────────────────────────────────────┘
  3877.  
  3878. Exemple :
  3879.             call Detect_Joystick
  3880.             test eax,Analog_A
  3881.             je @@Ok1
  3882.             ...
  3883. @@Ok1:
  3884.             test eax,Analog_B
  3885.             je @@Ok3
  3886.             ...
  3887. @@Ok3:
  3888.  
  3889.  
  3890. ┌──────────────────────────────────────────────────────────────────────────┐
  3891. │Add_Joystick   Add a new joystick to be use by the library                │
  3892. │                                                                          │
  3893. │In :                                                                      │
  3894. │        AX = Type Of joystick                                             │
  3895. │             Analog_A                                                     │
  3896. │             Analog_B                                                     │
  3897. │             Lpt_A                                                        │
  3898. │             Lpt_B                                                        │
  3899. │        BX = Address of port                                              │
  3900. │           = 1 Lpt1                                                       │
  3901. │           = 2 Lpt2                                                       │
  3902. │           = 3 Lpt3                                                       │
  3903. │           = 4 Lpt4                                                       │
  3904. │                                                                          │
  3905. │Out :                                                                     │
  3906. │        Carry = 0                                                         │
  3907. │             All Done                                                     │
  3908. │       ESI = Address of structure of joystick                             │
  3909. │                                                                          │
  3910. │        Carry = 1                                                         │
  3911. │             No Joystick Available                                        │
  3912. │                                                                          │
  3913. │Other Registers Change : None                                             │
  3914. │                                                                          │
  3915. └──────────────────────────────────────────────────────────────────────────┘
  3916.  
  3917. Exemple :
  3918.             mov ax,Analog_A
  3919.             call Add_Joystick
  3920.             jc No_Joystick_Available
  3921.  
  3922.  
  3923. ┌──────────────────────────────────────────────────────────────────────────┐
  3924. │Update_Joystick  Must be call often update all structure of all Joystick  │
  3925. │                 declare with Add_Joystick                                │
  3926. │                                                                          │
  3927. │In :                                                                      │
  3928. │                                                                          │
  3929. │Out :                                                                     │
  3930. │                                                                          │
  3931. │Other Registers Change : None                                             │
  3932. │                                                                          │
  3933. └──────────────────────────────────────────────────────────────────────────┘
  3934.  
  3935. Exemple :
  3936.             call Update_Joystick
  3937.  
  3938.  
  3939. ┌──────────────────────────────────────────────────────────────────────────┐
  3940. │Sub_Joystick   Delete a Joystick create by Add_Joystick                   │
  3941. │                                                                          │
  3942. │In :                                                                      │
  3943. │       ESI = Address of structure to be delete                            │
  3944. │                                                                          │
  3945. │Out :                                                                     │
  3946. │        Carry = 0                                                         │
  3947. │             All Done                                                     │
  3948. │                                                                          │
  3949. │        Carry = 1                                                         │
  3950. │             Structure not found                                          │
  3951. │                                                                          │
  3952. │Other Registers Change : None                                             │
  3953. │                                                                          │
  3954. └──────────────────────────────────────────────────────────────────────────┘
  3955.  
  3956. Exemple :
  3957.             mov esi,[Addr_Joy1]
  3958.             call Sub_Joystick
  3959.             jc Structure_Not_Found
  3960.  
  3961.  
  3962. ┌──────────────────────────────────────────────────────────────────────────┐
  3963. │Upper_Left     Take Value For Upper Left Joystick's Coordonate            │
  3964. │                                                                          │
  3965. │In :                                                                      │
  3966. │       ESI = Address of structure                                         │
  3967. │                                                                          │
  3968. │Out :                                                                     │
  3969. │        Carry = 0                                                         │
  3970. │             All Done                                                     │
  3971. │                                                                          │
  3972. │        Carry = 1                                                         │
  3973. │             No Fire Press                                                │
  3974. │                                                                          │
  3975. │                                                                          │
  3976. │Other Registers Change : None                                             │
  3977. │                                                                          │
  3978. └──────────────────────────────────────────────────────────────────────────┘
  3979.  
  3980. Exemple :
  3981.  
  3982. @@Loop:
  3983.             mov esi,[Addr_Joy1]
  3984.             call Upper_Left
  3985.             jc @@Loop
  3986.  
  3987.  
  3988. ┌──────────────────────────────────────────────────────────────────────────┐
  3989. │Lower_Right    Take Value For Lower Right Joystick's Coordonate           │
  3990. │                                                                          │
  3991. │In :                                                                      │
  3992. │       ESI = Address of structure                                         │
  3993. │                                                                          │
  3994. │Out :                                                                     │
  3995. │        Carry = 0                                                         │
  3996. │             All Done                                                     │
  3997. │                                                                          │
  3998. │        Carry = 1                                                         │
  3999. │             No Fire Press                                                │
  4000. │                                                                          │
  4001. │                                                                          │
  4002. │Other Registers Change : None                                             │
  4003. │                                                                          │
  4004. └──────────────────────────────────────────────────────────────────────────┘
  4005.  
  4006. Exemple :
  4007.  
  4008. @@Loop:
  4009.             mov esi,[Addr_Joy1]
  4010.             call Lower_Right
  4011.             jc @@Loop
  4012.  
  4013.  
  4014. ┌──────────────────────────────────────────────────────────────────────────┐
  4015. │Center         Take Value For Center Joystick's Coordonate                │
  4016. │                                                                          │
  4017. │In :                                                                      │
  4018. │       ESI = Address of structure                                         │
  4019. │                                                                          │
  4020. │Out :                                                                     │
  4021. │        Carry = 0                                                         │
  4022. │             All Done                                                     │
  4023. │                                                                          │
  4024. │        Carry = 1                                                         │
  4025. │             No Fire Press                                                │
  4026. │                                                                          │
  4027. │                                                                          │
  4028. │Other Registers Change : None                                             │
  4029. │                                                                          │
  4030. └──────────────────────────────────────────────────────────────────────────┘
  4031.  
  4032. Exemple :
  4033.  
  4034. @@Loop:
  4035.             mov esi,[Addr_Joy1]
  4036.             call Center
  4037.             jc @@Loop
  4038.  
  4039.  
  4040. ╔══════════════════════════════════════════════════════════════════════════╗
  4041. ║                                                                          ║
  4042. ║ Les déclarations de la librairie JOYSTICK                                ║
  4043. ║                                                                          ║
  4044. ╚══════════════════════════════════════════════════════════════════════════╝
  4045.  
  4046. Analog_A        = 1h
  4047. Analog_B        = 2h
  4048. Lpt_A           = 10h
  4049. Lpt_B           = 20h
  4050.  
  4051. Lpt1            = 1h
  4052. Lpt2            = 2h
  4053. Lpt3            = 3h
  4054. Lpt4            = 4h
  4055.  
  4056. Joy             Struc
  4057. J_Type          dw 0
  4058. J_Addr          dw 0
  4059. J_Min_X         dw 0
  4060. J_Max_X         dw 0
  4061. J_Min_Y         dw 0
  4062. J_Max_Y         dw 0
  4063. J_Center_X      dw 0
  4064. J_Center_Y      dw 0
  4065. J_Left          db 0
  4066. J_Right         db 0
  4067. J_Up            db 0
  4068. J_Down          db 0
  4069. J_Fire1         db 0
  4070. J_Fire2         db 0
  4071. J_Fire3         db 0
  4072. J_Fire4         db 0
  4073. Joy             ends
  4074.  
  4075.  
  4076. ╔══════════════════════════════════════════════════════════════════════════╗
  4077. ║                                                                          ║
  4078. ║ La librairie mémoire                                                     ║
  4079. ║                                                                          ║
  4080. ╚══════════════════════════════════════════════════════════════════════════╝
  4081.  
  4082. Cette librairie affiche la mémoire disponible en temps réel sur l'écran
  4083. monochrome.
  4084.  
  4085.  
  4086. ╔══════════════════════════════════════════════════════════════════════════╗
  4087. ║                                                                          ║
  4088. ║ Les fonctions de la librairie mémoire                                    ║
  4089. ║                                                                          ║
  4090. ╚══════════════════════════════════════════════════════════════════════════╝
  4091.  
  4092. ┌───────────┐
  4093. │Init Memory│
  4094. └───────────┘
  4095.  
  4096. ┌──────────────────────────────────────────────────────────────────────────┐
  4097. │Init_Memory    Turn the display memory on                                 │
  4098. │                                                                          │
  4099. │In :                                                                      │
  4100. │                                                                          │
  4101. │Out :                                                                     │
  4102. │                                                                          │
  4103. │Other Registers Change : None                                             │
  4104. │                                                                          │
  4105. └──────────────────────────────────────────────────────────────────────────┘
  4106.  
  4107. Exemple :
  4108.             call Init_Memory
  4109.  
  4110.  
  4111. ╔══════════════════════════════════════════════════════════════════════════╗
  4112. ║                                                                          ║
  4113. ║ Les fonctions du DPMI (interruption 31h) supportées par l'E.O.S          ║
  4114. ║                                                                          ║
  4115. ╚══════════════════════════════════════════════════════════════════════════╝
  4116.  
  4117. Les fonctions DPMI suivantes ne sont disponibles que pour les personnes qui
  4118. utilisent les versions WEOS.EXE, WEOSLITE.EXE ou WDEBUG.EXE. C'est à dire
  4119. les programmeurs Watcom (C++ ou Assembleur).
  4120.  
  4121. Function 0000h - Allocate LDT Descriptors
  4122. Function 0001h - Free LDT Descriptor
  4123. Function 0002h - Segment to Descriptor
  4124. Function 0003h - Get Next Selector Increment Value
  4125. Function 0006h - Get Segment Base Address
  4126. Function 0007h - Set Segment Base Address
  4127. Function 0008h - Set Segment Limit
  4128. Function 0009h - Set Descriptor Access Rights
  4129. Function 000Ah - Create Code Segment Alias Descriptor
  4130. Function 000Bh - Get Descriptor
  4131. Function 000Ch - Set Descriptor
  4132. Function 0100h - Allocate DOS Memory Block
  4133. Function 0101h - Free DOS Memory Block
  4134. Function 0102h - Resize DOS Memory Block
  4135. Function 0200h - Get Real Mode Interrupt Vector
  4136. Function 0201h - Set Real Mode Interrupt Vector
  4137. Function 0202h - Get Processor Exception Handler Vector
  4138. Function 0203h - Set Processor Exception Handler Vector
  4139. Function 0204h - Get Protected Mode Interrupt Vector
  4140. Function 0205h - Set Protected Mode Interrupt Vector
  4141. Function 0300h - Simulate Real Mode Interrupt
  4142. Function 0301h - Call Real Mode Procedure With Far Return Frame
  4143. Function 0302h - Call Real Mode Procedure With Iret Frame
  4144. Function 0400h - Get Version
  4145. Function 0500h - Get Free Memory Information
  4146. Function 0501h - Allocate Memory Block
  4147. Function 0502h - Free Memory Block
  4148. Function 0503h - Resize Memory Block
  4149. Function 0800h - Physical Address Mapping
  4150. Function 0900h - Get and Disable Virtual Interrupt State
  4151. Function 0901h - Get and Enable Virtual Interrupt State
  4152. Function 0902h - Get Virtual Interrupt State
  4153.  
  4154.  
  4155. ───────────────────────────────────────────────────────────────────────────────
  4156. Function 0000h - Allocate LDT Descriptors
  4157. ───────────────────────────────────────────────────────────────────────────────
  4158.  
  4159. In:
  4160.  
  4161.         AX = 0000h
  4162.         CX = Number of descriptors to allocate
  4163.  
  4164. Out:
  4165.  
  4166.        Carry = 0 if successful
  4167.         AX = Base selector
  4168.  
  4169.  
  4170. ───────────────────────────────────────────────────────────────────────────────
  4171. Function 0001h - Free LDT Descriptor
  4172. ───────────────────────────────────────────────────────────────────────────────
  4173.  
  4174. In:
  4175.  
  4176.         AX = 0001h
  4177.         BX = Selector to free
  4178.  
  4179. Out:
  4180.  
  4181.        Carry = 0 if successful
  4182.  
  4183.  
  4184. ───────────────────────────────────────────────────────────────────────────────
  4185. Function 0002h - Segment to Descriptor
  4186. ───────────────────────────────────────────────────────────────────────────────
  4187.  
  4188. In:
  4189.  
  4190.         AX = 0002h
  4191.         BX = Real mode segment address
  4192.  
  4193. Out:
  4194.        Carry = 0 if successful
  4195.         AX = Selector mapped to real mode segment
  4196.  
  4197.  
  4198. ───────────────────────────────────────────────────────────────────────────────
  4199. Function 0003h - Get Next Selector Increment Value
  4200. ───────────────────────────────────────────────────────────────────────────────
  4201.  
  4202. In:
  4203.  
  4204.         AX = 0003h
  4205.  
  4206. Out:
  4207.  
  4208.        Carry = 0
  4209.         AX = Value to add to get to next selector
  4210.  
  4211.  
  4212. ───────────────────────────────────────────────────────────────────────────────
  4213. Function 0006h - Get Segment Base Address
  4214. ───────────────────────────────────────────────────────────────────────────────
  4215.  
  4216. In:
  4217.  
  4218.         AX = 0006h
  4219.         BX = Selector
  4220.  
  4221. Out:
  4222.  
  4223.        Carry = 0 if successful
  4224.         CX:DX = 32-bit linear base address of segment
  4225.  
  4226.  
  4227. ───────────────────────────────────────────────────────────────────────────────
  4228. Function 0007h - Set Segment Base Address
  4229. ───────────────────────────────────────────────────────────────────────────────
  4230.  
  4231. In:
  4232.  
  4233.         AX = 0007h
  4234.         BX = Selector
  4235.         CX:DX = 32-bit linear base address for segment
  4236.  
  4237. Out:
  4238.  
  4239.        Carry = 0 if successful
  4240.  
  4241.  
  4242. ───────────────────────────────────────────────────────────────────────────────
  4243. Function 0008h - Set Segment Limit
  4244. ───────────────────────────────────────────────────────────────────────────────
  4245.  
  4246. In:
  4247.  
  4248.         AX = 0008h
  4249.         BX = Selector
  4250.         CX:DX = 32-bit segment limit
  4251.  
  4252. Out:
  4253.        Carry = 0 if successful
  4254.  
  4255.  
  4256. ───────────────────────────────────────────────────────────────────────────────
  4257. Function 0009h - Set Descriptor Access Rights
  4258. ───────────────────────────────────────────────────────────────────────────────
  4259.  
  4260. In:
  4261.  
  4262.         AX = 0009h
  4263.         BX = Selector
  4264.         CX = rights/type word
  4265.  
  4266.  
  4267. Out:
  4268.        Carry = 0 if successful
  4269.  
  4270. Notes:
  4271.     The access rights/type word passed to the function in CX has
  4272.     the following format :
  4273.  
  4274.     Bit: 15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  4275.        ┌───┬───┬───┬───┬───────────────┬───┬───────┬───┬───┬───┬───┬───┐
  4276.        │ G │B/D│ 0 │ 0 │       0       │ 1 │  DPL  │ 1 │C/D│E/C│W/R│ A │
  4277.        └───┴───┴───┴───┴───────────────┴───┴───────┴───┴───┴───┴───┴───┘
  4278.  
  4279.     G  h - 0=byte granular, 1=page granular
  4280.     B/Dh - 0=default 16bit, 1=default 32bit
  4281.     DPLh - must be equal to caller's CPL
  4282.     C/Dh - 0=data, 1=code
  4283.     E/Ch - data: 0=expand-up, 1=expand-down
  4284.           code: must be 0 (non-conforming)
  4285.     W/Rh - data: 0=read, 1=read/write
  4286.           code: must be 1 (readable)
  4287.     A  h - 0=not accessed, 1=accessed
  4288.  
  4289.  
  4290. ───────────────────────────────────────────────────────────────────────────────
  4291. Function 000Ah - Create Code Segment Alias Descriptor
  4292. ───────────────────────────────────────────────────────────────────────────────
  4293.  
  4294. In:
  4295.  
  4296.         AX = 000Ah
  4297.         BX = Code segment selector
  4298.  
  4299. Out:
  4300.        Carry = 0 if successful
  4301.         AX = New data selector
  4302.  
  4303.  
  4304. ───────────────────────────────────────────────────────────────────────────────
  4305. Function 000Bh - Get Descriptor
  4306. ───────────────────────────────────────────────────────────────────────────────
  4307.  
  4308. In:
  4309.  
  4310.         AX = 000Bh
  4311.         BX = Selector
  4312.         ES:EDI = Pointer to an 8 byte buffer to receive copy of descriptor
  4313.  
  4314. Out:
  4315.        Carry = 0 if successful
  4316.         ES:EDI = Pointer to buffer that contains descriptor
  4317.  
  4318.  
  4319. ───────────────────────────────────────────────────────────────────────────────
  4320. Function 000Ch - Set Descriptor
  4321. ───────────────────────────────────────────────────────────────────────────────
  4322.  
  4323. In:
  4324.  
  4325.         AX = 000Ch
  4326.         BX = Selector
  4327.         ES:EDI = Pointer to an 8 byte buffer that contains descriptor
  4328.  
  4329. Out:
  4330.        Carry = 0 if successful
  4331.  
  4332.  
  4333. ───────────────────────────────────────────────────────────────────────────────
  4334. Function 0100h - Allocate DOS Memory Block
  4335. ───────────────────────────────────────────────────────────────────────────────
  4336.  
  4337. In:
  4338.  
  4339.         AX = 0100h
  4340.         BX = Number of paragraphs (16 byte blocks) desired
  4341.  
  4342. Out:
  4343.  
  4344.        Carry = 0 if successful
  4345.         AX = Initial real mode segment of allocated block
  4346.         DX = Selector for allocated block
  4347.  
  4348.        Carry = 1 if error
  4349.         AX = DOS error code:
  4350.              07h memory control blocks damaged
  4351.              08h insufficient memory available to allocate as requested
  4352.         BX = Size of largest available block in paragraphs
  4353.  
  4354.  
  4355. ───────────────────────────────────────────────────────────────────────────────
  4356. Function 0101h - Free DOS Memory Block
  4357. ───────────────────────────────────────────────────────────────────────────────
  4358.  
  4359. In:
  4360.  
  4361.         AX = 0101h
  4362.         DX = Selector of block to free
  4363.  
  4364. Out:
  4365.  
  4366.        Carry = 0 if successful
  4367.  
  4368.        Carry = 1 if error
  4369.         AX = DOS error code:
  4370.              07h memory control blocks damaged
  4371.              09h incorrect memory segment specified
  4372.  
  4373.  
  4374. ───────────────────────────────────────────────────────────────────────────────
  4375. Function 0102h - Resize DOS Memory Block
  4376. ───────────────────────────────────────────────────────────────────────────────
  4377.  
  4378. In:
  4379.  
  4380.         AX = 0102h
  4381.         BX = New block size in paragraphs
  4382.         DX = Selector of block to modify
  4383.  
  4384. Out:
  4385.  
  4386.        Carry = 0 if successful
  4387.  
  4388.        Carry = 1 if error
  4389.         AX = DOS error code:
  4390.              07h memory control blocks damaged
  4391.              08h insufficient memory  available to allocate as requested
  4392.              09h incorrect memory segment specified
  4393.         BX = Maximum block size possible in paragraphs
  4394.  
  4395.  
  4396. ───────────────────────────────────────────────────────────────────────────────
  4397. Function 0200h - Get Real Mode Interrupt Vector
  4398. ───────────────────────────────────────────────────────────────────────────────
  4399.  
  4400. In:
  4401.  
  4402.         AX = 0200h
  4403.         BL = Interrupt number
  4404.  
  4405. Out:
  4406.        Carry = 0 if successful
  4407.         CX:DX = Segment:Offset of real mode interrupt handler
  4408.  
  4409.  
  4410. ───────────────────────────────────────────────────────────────────────────────
  4411. Function 0201h - Set Real Mode Interrupt Vector
  4412. ───────────────────────────────────────────────────────────────────────────────
  4413.  
  4414. In:
  4415.  
  4416.         AX = 0201h
  4417.         BL = Interrupt number
  4418.         CX:DX = Segment:Offset of real mode interrupt handler
  4419.  
  4420. Out:
  4421.        Carry = 0 if successful
  4422.  
  4423.  
  4424. ───────────────────────────────────────────────────────────────────────────────
  4425. Function 0202h - Get Processor Exception Handler Vector
  4426. ───────────────────────────────────────────────────────────────────────────────
  4427.  
  4428. In:
  4429.  
  4430.         AX = 0202h
  4431.         BL = Exception/fault number (00h-1Fh)
  4432.  
  4433. Out:
  4434.  
  4435.        Carry = 0 if successful
  4436.         CX:EDX = Selector:Offset of exception handler
  4437.  
  4438.  
  4439. ───────────────────────────────────────────────────────────────────────────────
  4440. Function 0203h - Set Processor Exception Handler Vector
  4441. ───────────────────────────────────────────────────────────────────────────────
  4442.  
  4443.  
  4444. In:
  4445.  
  4446.         AX = 0203h
  4447.         BL = Exception/fault number (00h-1Fh)
  4448.         CX:EDX = Selector:Offset of exception handler
  4449.  
  4450. Out:
  4451.        Carry = 0 if successful
  4452.  
  4453.  
  4454. ───────────────────────────────────────────────────────────────────────────────
  4455. Function 0204h - Get Protected Mode Interrupt Vector
  4456. ───────────────────────────────────────────────────────────────────────────────
  4457.  
  4458. In:
  4459.  
  4460.         AX = 0204h
  4461.         BL = Interrupt number
  4462.  
  4463. Out:
  4464.        Carry = 0
  4465.         CX:EDX = Selector:Offset of exception handler
  4466.  
  4467.  
  4468. ───────────────────────────────────────────────────────────────────────────────
  4469. Function 0205h - Set Protected Mode Interrupt Vector
  4470. ───────────────────────────────────────────────────────────────────────────────
  4471.  
  4472. In:
  4473.  
  4474.         AX = 0205h
  4475.         BL = Interrupt number
  4476.         CX:EDX = Selector:Offset of exception handler
  4477.  
  4478. Out:
  4479.  
  4480.        Carry = 0 if successful
  4481.  
  4482.  
  4483. ───────────────────────────────────────────────────────────────────────────────
  4484. Function 0300h - Simulate Real Mode Interrupt
  4485. ───────────────────────────────────────────────────────────────────────────────
  4486.  
  4487. In:
  4488.  
  4489.         AX = 0300h
  4490.         BL = Interrupt number
  4491.         BH = 0
  4492.         CX = Number of words to copy from protected mode to real mode stack
  4493.         ES:EDI = Selector:Offset of real mode call structure
  4494.  
  4495. Out:
  4496.  
  4497.        Carry = 0 if successful
  4498.         ES:EDI = Selector:Offset of modified real mode call structure
  4499.                  in the folling format:
  4500.                 Offset  Length  Contents
  4501.                 00h     4       EDI
  4502.                 04h     4       ESI
  4503.                 08h     4       EBP
  4504.                 0ch     4       reserved, should be zero
  4505.                 10h     4       EBX
  4506.                 14h     4       EDX
  4507.                 18h     4       ECX
  4508.                 1ch     4       EAX
  4509.                 20h     2       CPU status flags
  4510.                 22h     2       ES
  4511.                 24h     2       DS
  4512.                 26h     2       FS
  4513.                 28h     2       GS
  4514.                 2ah     2       IP (reserved, ignored)
  4515.                 2ch     2       CS (reserved, ignored)
  4516.                 2eh     2       SP
  4517.                 30h     2       SS
  4518.  
  4519.  
  4520. ───────────────────────────────────────────────────────────────────────────────
  4521. Function 0301h - Call Real Mode Procedure With Far Return Frame
  4522. ───────────────────────────────────────────────────────────────────────────────
  4523.  
  4524. In:
  4525.  
  4526.         AX = 0301h
  4527.         BH = 0
  4528.         CX = Number of words to copy from protected mode to real mode stack
  4529.         ES:EDI = Selector:Offset of real mode call structure
  4530.  
  4531. Out:
  4532.  
  4533.        Carry = 0 if successful
  4534.         ES:EDI = Selector:Offset of  modified real mode call structure
  4535.                  in the folling format:
  4536.                 Offset  Length  Contents
  4537.                 00h     4       EDI
  4538.                 04h     4       ESI
  4539.                 08h     4       EBP
  4540.                 0ch     4       reserved, ingored
  4541.                 10h     4       EBX
  4542.                 14h     4       EDX
  4543.                 18h     4       ECX
  4544.                 1ch     4       EAX
  4545.                 20h     2       CPU status flags
  4546.                 22h     2       ES
  4547.                 24h     2       DS
  4548.                 26h     2       FS
  4549.                 28h     2       GS
  4550.                 2ah     2       IP
  4551.                 2ch     2       CS
  4552.                 2eh     2       SP
  4553.                 30h     2       SS
  4554.  
  4555.  
  4556. ───────────────────────────────────────────────────────────────────────────────
  4557. Function 0302h - Call Real Mode Procedure With Iret Frame
  4558. ───────────────────────────────────────────────────────────────────────────────
  4559.  
  4560. In:
  4561.  
  4562.         AX = 0302h
  4563.         BH = 0
  4564.         CX = Number of words to copy from protected mode to real mode stack
  4565.         ES:EDI = Selector:Offset of real mode call structure
  4566.  
  4567. Out:
  4568.  
  4569.        Carry = 0 if successful
  4570.         ES:EDI = Selector:Offset of modified real mode call structure
  4571.                 Offset  Length  Contents
  4572.                 00h     4       EDI
  4573.                 04h     4       ESI
  4574.                 08h     4       EBP
  4575.                 0ch     4       reserved, ingored
  4576.                 10h     4       EBX
  4577.                 14h     4       EDX
  4578.                 18h     4       ECX
  4579.                 1ch     4       EAX
  4580.                 20h     2       CPU status flags
  4581.                 22h     2       ES
  4582.                 24h     2       DS
  4583.                 26h     2       FS
  4584.                 28h     2       GS
  4585.                 2ah     2       IP
  4586.                 2ch     2       CS
  4587.                 2eh     2       SP
  4588.                 30h     2       SS
  4589.  
  4590.  
  4591. ───────────────────────────────────────────────────────────────────────────────
  4592. Function 0400h - Get Version
  4593. ───────────────────────────────────────────────────────────────────────────────
  4594.  
  4595. In:
  4596.  
  4597.         AX = 0400h
  4598.  
  4599. Out:
  4600.  
  4601.         AH = Major version
  4602.         AL = Minor version
  4603.         BX = Flags
  4604.         CL = Processor type
  4605.              02 = 80286
  4606.              03 = 80386
  4607.              04 = 80486
  4608.         DH = Current value of virtual master PIC base interrupt
  4609.         DL = Current value of virtual slave PIC base interrupt
  4610.        Carry = 0
  4611.  
  4612.  
  4613. ───────────────────────────────────────────────────────────────────────────────
  4614. Function 0500h - Get Free Memory Information
  4615. ───────────────────────────────────────────────────────────────────────────────
  4616.  
  4617. In:
  4618.  
  4619.         AX = 0500h
  4620.         ES:EDI = Selector:Offset of 30h byte buffer
  4621.  
  4622. Out:
  4623.  
  4624.        Carry = 0 if successful
  4625.         ES:EDI = Selector:Offset of buffer with the following structure
  4626.  
  4627.  
  4628. ───────────────────────────────────────────────────────────────────────────────
  4629. Function 0501h - Allocate Memory Block
  4630. ───────────────────────────────────────────────────────────────────────────────
  4631.  
  4632. In:
  4633.  
  4634.         AX = 0501h
  4635.         BX:CX = Size of memory block to allocate in bytes
  4636.  
  4637. Out:
  4638.  
  4639.        Carry = 0 if successful
  4640.         BX:CX = Linear address of allocated memory block
  4641.         SI:DI = Memory block handle (used to resize and free)
  4642.  
  4643.  
  4644. ───────────────────────────────────────────────────────────────────────────────
  4645. Function 0502h - Free Memory Block
  4646. ───────────────────────────────────────────────────────────────────────────────
  4647.  
  4648. In:
  4649.  
  4650.         AX = 0502h
  4651.         SI:DI = Handle of memory block to free
  4652.  
  4653. Out:
  4654.  
  4655.        Carry = 0 if successful
  4656.  
  4657.  
  4658. ───────────────────────────────────────────────────────────────────────────────
  4659. Function 0503h - Resize Memory Block
  4660. ───────────────────────────────────────────────────────────────────────────────
  4661.  
  4662.  
  4663. In:
  4664.  
  4665.         AX = 0503h
  4666.         BX:CX = New size of memory block to allocate in bytes
  4667.         SI:DI = Handle of memory block to resize
  4668.  
  4669. Out:
  4670.  
  4671.        Carry = 0 if successful
  4672.         BX:CX = New linear address of memory block
  4673.         SI:DI = New handle of memory block
  4674.  
  4675.  
  4676. ───────────────────────────────────────────────────────────────────────────────
  4677. Function 0800h - Physical Address Mapping
  4678. ───────────────────────────────────────────────────────────────────────────────
  4679.  
  4680. In:
  4681.  
  4682.         AX = 0800h
  4683.         BX:CX = Physical address of memory
  4684.         SI:DI = Size of region to map in bytes
  4685.  
  4686. Out:
  4687.  
  4688.        Carry = 0 if successful
  4689.         BX:CX =  Linear address  that can be used to access the physical memory
  4690.  
  4691.  
  4692. ───────────────────────────────────────────────────────────────────────────────
  4693. Function 0900h - Get and Disable Virtual Interrupt State
  4694. ───────────────────────────────────────────────────────────────────────────────
  4695.  
  4696. In:
  4697.  
  4698.         AX = 0900h
  4699.  
  4700. Out:
  4701.  
  4702.        Carry = 0
  4703.         AL = 0 if virtual interrupts were previously disabled
  4704.         AL = 1 if virtual interrupts were previously enabled
  4705.  
  4706.  
  4707. ───────────────────────────────────────────────────────────────────────────────
  4708. Function 0901h - Get and Enable Virtual Interrupt State
  4709. ───────────────────────────────────────────────────────────────────────────────
  4710.  
  4711. In:
  4712.  
  4713.         AX = 0901h
  4714.  
  4715. Out:
  4716.  
  4717.        Carry = 0
  4718.         AL = 0 if virtual interrupts were previously disabled
  4719.         AL = 1 if virtual interrupts were previously enabled
  4720.  
  4721.  
  4722. ───────────────────────────────────────────────────────────────────────────────
  4723. Function 0902h - Get Virtual Interrupt State
  4724. ───────────────────────────────────────────────────────────────────────────────
  4725.  
  4726. In:
  4727.  
  4728.         AX = 0902h
  4729.  
  4730. Out:
  4731.        Carry = 0
  4732.         AL = 0 if virtual interrupts are disabled
  4733.         AL = 1 if virtual interrupts are enabled
  4734.  
  4735.  
  4736. ╔══════════════════════════════════════════════════════════════════════════╗
  4737. ║                                                                          ║
  4738. ║ Les fonctions du DOS (interruption 21h) supportées par l'E.O.S           ║
  4739. ║                                                                          ║
  4740. ╚══════════════════════════════════════════════════════════════════════════╝
  4741.  
  4742. Function  1h - Keyboard Input with Echo
  4743. Function  2h - Display Output
  4744. Function  3h - Wait for Auxiliary Device Input
  4745. Function  4h - Auxiliary Output
  4746. Function  5h - Printer Output
  4747. Function  6h - Direct Console I/O
  4748. Function  7h - Direct Console Input Without Echo
  4749. Function  8h - Console Input Without Echo
  4750. Function  9h - Print String
  4751. Function  Ah - Buffered Keyboard Input
  4752. Function  Bh - Check Standard Input Status
  4753. Function  Ch - Clear Keyboard Buffer and Invoke Keyboard Function
  4754. Function  Dh - Disk Reset
  4755. Function  Eh - Select Disk
  4756. Function  Fh - Open a File Using FCB
  4757. Function 10h - Close a File Using FCB
  4758. Function 11h - Search for First Entry Using FCB
  4759. Function 12h - Search for Next Entry Using FCB
  4760. Function 13h - Delete File Using FCB
  4761. Function 14h - Sequential Read Using FCB
  4762. Function 15h - Sequential Write Using FCB
  4763. Function 16h - Create a File Using FCB
  4764. Function 17h - Rename a File Using FCB
  4765. Function 19h - Get Current Default Drive
  4766. Function 1Ah - Set Disk Transfer Address (DTA)
  4767. Function 21h - Random Read Using FCB
  4768. Function 22h - Random Write Using FCB
  4769. Function 23h - Get File Size Using FCB
  4770. Function 24h - Set Relative Record Field in FCB
  4771. Function 25h - Set Interrupt Vector
  4772. Function 27h - Random Block Read Using FCB
  4773. Function 28h - Random Block Write Using FCB
  4774. Function 2Ah - Get Date
  4775. Function 2Bh - Set Date
  4776. Function 2Ch - Get Time
  4777. Function 2Dh - Set Time
  4778. Function 2Eh - Set/Reset Verify Switch
  4779. Function 2Fh - Get Disk Transfer Address (DTA)
  4780. Function 30h - Get DOS Version Number
  4781. Function 33h - Get/Set System Values (Ctl-Break/Boot Drive)
  4782. Function 34h - Get Address to DOS Critical Flag
  4783. Function 35h - Get Interrupt Vector
  4784. Function 36h - Get Disk Free Space
  4785. Function 37h - Get/Set Switch Character
  4786. Function 39h - Create Subdirectory
  4787. Function 3Ah - Remove Subdirectory
  4788. Function 3Bh - Change Current Directory
  4789. Function 3Ch - Create File Using Handle
  4790. Function 3Dh - Open File Using Handle
  4791. Function 3Eh - Close File Using Handle
  4792. Function 3Fh - Read From File or Device Using Handle
  4793. Function 40h - Write To File or Device Using Handle
  4794. Function 41h - Delete File
  4795. Function 42h - Move File Pointer Using Handle
  4796. Function 43h - Get/Set File Attributes
  4797. Function 45h - Duplicate File Handle
  4798. Function 46h - Force Duplicate File Handle
  4799. Function 47h - Get Current Directory
  4800. Function 48h - Allocate Memory
  4801. Function 49h - Free Allocated Memory
  4802. Function 4Ah - Modify Allocated Memory Block  (SETBLOCK)
  4803. Function 4Bh - Load and Execute Program
  4804. Function 4Ch - Terminate Process With Return Code
  4805. Function 4Dh - Get Return Code of Sub-process
  4806. Function 4Eh - Find First Matching File
  4807. Function 4Fh - Find Next Matching File
  4808. Function 54h - Get Verify Setting
  4809. Function 56h - Rename File
  4810. Function 58h - Get/Set Memory Allocation Strategy
  4811. Function 59h - Get Extended Error Information
  4812. Function 5Ah - Create Temporary File
  4813. Function 5Bh - Create File
  4814. Function 60h - Get Fully Qualified File Name
  4815.  
  4816.  
  4817. ───────────────────────────────────────────────────────────────────────────────
  4818. Function 1h - Keyboard Input with Echo
  4819. ───────────────────────────────────────────────────────────────────────────────
  4820.  
  4821. In:
  4822.     AH = 01
  4823. Out:
  4824.     AL = character from standard input device
  4825.  
  4826.  
  4827. ───────────────────────────────────────────────────────────────────────────────
  4828. Function 2h - Display Output
  4829. ───────────────────────────────────────────────────────────────────────────────
  4830.  
  4831. In:
  4832.     AH = 02
  4833.     DL = character to output
  4834. Out:
  4835.  
  4836.  
  4837. ───────────────────────────────────────────────────────────────────────────────
  4838. Function 3h - Wait for Auxiliary Device Input
  4839. ───────────────────────────────────────────────────────────────────────────────
  4840.  
  4841. In:
  4842.     AH = 03
  4843. Out:
  4844.     AL = character from the auxiliary device
  4845.  
  4846.  
  4847. ───────────────────────────────────────────────────────────────────────────────
  4848. Function 4h - Auxiliary Output
  4849. ───────────────────────────────────────────────────────────────────────────────
  4850.  
  4851. In:
  4852.     AH = 04
  4853.     DL = character to output
  4854. Out:
  4855.  
  4856.  
  4857. ───────────────────────────────────────────────────────────────────────────────
  4858. Function 5h - Printer Output
  4859. ───────────────────────────────────────────────────────────────────────────────
  4860.  
  4861. In:
  4862.     AH = 05
  4863.     DL = character to output
  4864. Out:
  4865.  
  4866.  
  4867. ───────────────────────────────────────────────────────────────────────────────
  4868. Function 6h - Direct Console I/O
  4869. ───────────────────────────────────────────────────────────────────────────────
  4870.  
  4871. In:
  4872.     AH = 06
  4873.     DL = (0-FE) character to output
  4874.        = FF if console input request
  4875. Out:
  4876.     AL = input character if console input request (DL=FF)
  4877.     ZF = 0    if console request character available (in AL)
  4878.        = 1    if no character is ready, and function request
  4879.          was console input
  4880.  
  4881.  
  4882. ───────────────────────────────────────────────────────────────────────────────
  4883. Function 7h - Direct Console Input Without Echo
  4884. ───────────────────────────────────────────────────────────────────────────────
  4885.  
  4886. In:
  4887.     AH = 07
  4888. Out:
  4889.     AL = character from STDIN
  4890.  
  4891.  
  4892. ───────────────────────────────────────────────────────────────────────────────
  4893. Function 8h - Console Input Without Echo
  4894. ───────────────────────────────────────────────────────────────────────────────
  4895.  
  4896. In:
  4897.     AH = 08
  4898. Out:
  4899.     AL = character from STDIN
  4900.  
  4901.  
  4902. ───────────────────────────────────────────────────────────────────────────────
  4903. Function 9h - Print String
  4904. ───────────────────────────────────────────────────────────────────────────────
  4905.  
  4906. In:
  4907.     AH = 09
  4908.         DS:EDX = pointer to string ending in "$"
  4909. Out:
  4910.  
  4911.  
  4912. ───────────────────────────────────────────────────────────────────────────────
  4913. Function Ah - Buffered Keyboard Input
  4914. ───────────────────────────────────────────────────────────────────────────────
  4915.  
  4916. In:
  4917.     AH = 0A
  4918.         DS:EDX = pointer to input buffer
  4919. Out:
  4920.  
  4921.  
  4922. ───────────────────────────────────────────────────────────────────────────────
  4923. Function Bh - Check Standard Input Status
  4924. ───────────────────────────────────────────────────────────────────────────────
  4925.  
  4926. In:
  4927.     AH = 0B
  4928. Out:
  4929.     AL = 00 if no character available
  4930.        = FF if character available
  4931.  
  4932.  
  4933. ───────────────────────────────────────────────────────────────────────────────
  4934. Function Ch - Clear Keyboard Buffer and Invoke Keyboard Function
  4935. ───────────────────────────────────────────────────────────────────────────────
  4936.  
  4937. In:
  4938.     AH = 0C
  4939.     AL = 01, 06, 07, 08 or 0A   (INT 21 input functions)
  4940. Out:
  4941.  
  4942.  
  4943. ───────────────────────────────────────────────────────────────────────────────
  4944. Function Dh - Disk Reset
  4945. ───────────────────────────────────────────────────────────────────────────────
  4946.  
  4947. In:
  4948.     AH = 0D
  4949. Out:
  4950.  
  4951.  
  4952. ───────────────────────────────────────────────────────────────────────────────
  4953. Function Eh - Select Disk
  4954. ───────────────────────────────────────────────────────────────────────────────
  4955.  
  4956. In:
  4957.     AH = 0E
  4958.         DL = zero based, drive number (0-25, A:h - Z:)
  4959. Out:
  4960.     AL = one based, total number of logical drives including
  4961.          hardfiles (1-26)
  4962.  
  4963.  
  4964. ───────────────────────────────────────────────────────────────────────────────
  4965. Function Fh - Open a File Using FCB
  4966. ───────────────────────────────────────────────────────────────────────────────
  4967.  
  4968. In:
  4969.     AH = 0F
  4970.         DS:EDX = pointer to unopened FCB
  4971.  
  4972. Out:
  4973.     AL = 00 if file opened
  4974.        = FF if unable to open
  4975.  
  4976.  
  4977. ───────────────────────────────────────────────────────────────────────────────
  4978. Function 10h - Close a File Using FCB
  4979. ───────────────────────────────────────────────────────────────────────────────
  4980.  
  4981. In:
  4982.     AH = 10h
  4983.         DS:EDX = pointer to opened FCB
  4984. Out:
  4985.     AL = 00  if file closed
  4986.        = FF  if file not closed
  4987.  
  4988.  
  4989. ───────────────────────────────────────────────────────────────────────────────
  4990. Function 11h - Search for First Entry Using FCB
  4991. ───────────────────────────────────────────────────────────────────────────────
  4992.  
  4993. In:
  4994.     AH = 11h
  4995.         DS:EDX = pointer to unopened FCB
  4996. Out:
  4997.     AL = 00 if matching file found
  4998.        = FF if file not found
  4999.  
  5000.  
  5001. ───────────────────────────────────────────────────────────────────────────────
  5002. Function 12h - Search for Next Entry Using FCB
  5003. ───────────────────────────────────────────────────────────────────────────────
  5004.  
  5005. In:
  5006.     AH = 12h
  5007.         DS:EDX = pointer to unopened FCB
  5008. Out:
  5009.     AL = 00 if file found
  5010.        = FF if file not found
  5011.  
  5012.  
  5013. ───────────────────────────────────────────────────────────────────────────────
  5014. Function 13h - Delete File Using FCB
  5015. ───────────────────────────────────────────────────────────────────────────────
  5016.  
  5017. In:
  5018.     AH = 13h
  5019.         DS:EDX = pointer to an unopened FCB
  5020. Out:
  5021.     AL = 00 if file deleted
  5022.        = FF if file not found
  5023.  
  5024.  
  5025. ───────────────────────────────────────────────────────────────────────────────
  5026. Function 14h - Sequential Read Using FCB
  5027. ───────────────────────────────────────────────────────────────────────────────
  5028.  
  5029. In:
  5030.     AH = 14h
  5031.         DS:EDX = pointer to an opened FCB
  5032. Out:
  5033.     AL = 00 if successful read
  5034.        = 01 if end of file (no data read)
  5035.            = 02 if DTA is too small
  5036.        = 03 if end of file or partial record read
  5037.  
  5038.  
  5039. ───────────────────────────────────────────────────────────────────────────────
  5040. Function 15h - Sequential Write Using FCB
  5041. ───────────────────────────────────────────────────────────────────────────────
  5042.  
  5043. In:
  5044.     AH = 15h
  5045.         DS:EDX = pointer to an opened FCB
  5046.  
  5047. Out:
  5048.     AL = 00 if write was successful
  5049.        = 01 if diskette is full or read only
  5050.            = 02 if DTA is too small
  5051.  
  5052.  
  5053. ───────────────────────────────────────────────────────────────────────────────
  5054. Function 16h - Create a File Using FCB
  5055. ───────────────────────────────────────────────────────────────────────────────
  5056.  
  5057.  
  5058. In:
  5059.     AH = 16h
  5060.         DS:EDX = pointer to an unopened FCB
  5061. Out:
  5062.     AL = 00 if file created
  5063.        = FF if file creation failed
  5064.  
  5065.  
  5066. ───────────────────────────────────────────────────────────────────────────────
  5067. Function 17h - Rename a File Using FCB
  5068. ───────────────────────────────────────────────────────────────────────────────
  5069.  
  5070. In:
  5071.     AH = 17h
  5072.         DS:EDX = pointer to a modified FCB
  5073. Out:
  5074.     AL = 00 if file renamed
  5075.        = FF if file not renamed
  5076.  
  5077.  
  5078. ───────────────────────────────────────────────────────────────────────────────
  5079. Function 19h - Get Current Default Drive
  5080. ───────────────────────────────────────────────────────────────────────────────
  5081.  
  5082. In:
  5083.     AH = 19h
  5084. Out:
  5085.     AL = current default drive (0=A,1=B,etc)
  5086.  
  5087.  
  5088. ───────────────────────────────────────────────────────────────────────────────
  5089. Function 1Ah - Set Disk Transfer Address (DTA)
  5090. ───────────────────────────────────────────────────────────────────────────────
  5091.  
  5092. In:
  5093.     AH = 1A
  5094.         DS:EDX = pointer to DTA
  5095. Out:
  5096.  
  5097.  
  5098. ───────────────────────────────────────────────────────────────────────────────
  5099. Function 21h - Random Read Using FCB
  5100. ───────────────────────────────────────────────────────────────────────────────
  5101.  
  5102. In:
  5103.     AH = 21h
  5104.         DS:EDX = pointer to an opened FCB
  5105. Out:
  5106.     AL = 00 if read successful
  5107.        = 01 if EOF (no data read)
  5108.            = 02 if DTA is too small
  5109.        = 03 if EOF (partial record read)
  5110.  
  5111.  
  5112. ───────────────────────────────────────────────────────────────────────────────
  5113. Function 22h - Random Write Using FCB
  5114. ───────────────────────────────────────────────────────────────────────────────
  5115.  
  5116.  
  5117. In:
  5118.     AH = 22h
  5119.         DS:EDX = far pointer to an opened FCB
  5120.  
  5121. Out:
  5122.     AL = 00 if write successful
  5123.        = 01 if diskette full or read only
  5124.            = 02 if DTA is too small
  5125.  
  5126.  
  5127. ───────────────────────────────────────────────────────────────────────────────
  5128. Function 23h - Get File Size Using FCB
  5129. ───────────────────────────────────────────────────────────────────────────────
  5130.  
  5131. In:
  5132.     AH = 23h
  5133.         DS:EDX = pointer to an unopened FCB
  5134. Out:
  5135.     AL = 00 if successful
  5136.        = FF if file not found
  5137.  
  5138.  
  5139. ───────────────────────────────────────────────────────────────────────────────
  5140. Function 24h - Set Relative Record Field in FCB
  5141. ───────────────────────────────────────────────────────────────────────────────
  5142.  
  5143. In:
  5144.     AH = 24h
  5145.         DS:EDX = pointer to an opened FCB
  5146.  
  5147. Out:
  5148.  
  5149.  
  5150. ───────────────────────────────────────────────────────────────────────────────
  5151. Function 25h - Set Interrupt Vector
  5152. ───────────────────────────────────────────────────────────────────────────────
  5153.  
  5154. In:
  5155.     AH = 25h
  5156.     AL = interrupt number
  5157.         DS:EDX = pointer to interrupt handler
  5158. Out:
  5159.  
  5160.  
  5161. ───────────────────────────────────────────────────────────────────────────────
  5162. Function 27h - Random Block Read Using FCB
  5163. ───────────────────────────────────────────────────────────────────────────────
  5164.  
  5165. In:
  5166.     AH = 27h
  5167.     CX = number of records to read
  5168.         DS:EDX = pointer to an opened FCB
  5169. Out:
  5170.     AL = 00 if read was successful
  5171.        = 01 if EOF (no data read)
  5172.            = 02 if DTA is too small
  5173.        = 03 if EOF (partial record read)
  5174.     CX = actual number of records read
  5175.  
  5176.  
  5177. ───────────────────────────────────────────────────────────────────────────────
  5178. Function 28h - Random Block Write Using FCB
  5179. ───────────────────────────────────────────────────────────────────────────────
  5180.  
  5181.  
  5182. In:
  5183.     AH = 28h
  5184.     CX = number of records to write
  5185.         DS:EDX = pointer to an opened FCB
  5186.  
  5187. Out:
  5188.     AL = 00 if write successful
  5189.        = 01 if diskette full or read only
  5190.            = 02 if DTA is too small
  5191.     CX = number of records written
  5192.  
  5193.  
  5194. ───────────────────────────────────────────────────────────────────────────────
  5195. Function 2Ah - Get Date
  5196. ───────────────────────────────────────────────────────────────────────────────
  5197.  
  5198. In:
  5199.     AH = 2A
  5200. Out:
  5201.     AL = day of the week (0=Sunday)
  5202.     CX = year (1980-2099)
  5203.     DH = month (1-12)
  5204.     DL = day (1-31)
  5205.  
  5206.  
  5207. ───────────────────────────────────────────────────────────────────────────────
  5208. Function 2Bh - Set Date
  5209. ───────────────────────────────────────────────────────────────────────────────
  5210.  
  5211. IN:
  5212.     AH = 2B
  5213.     CX = year (1980-2099)
  5214.     DH = month (1-12)
  5215.     DL = day (1-31)
  5216. Out:
  5217.     AL = 00 if date change successful
  5218.        = FF if invalid date
  5219.  
  5220.  
  5221. ───────────────────────────────────────────────────────────────────────────────
  5222. Function 2Ch - Get Time
  5223. ───────────────────────────────────────────────────────────────────────────────
  5224.  
  5225. In:
  5226.     AH = 2C
  5227. Out:
  5228.     CH = hour (0-23)
  5229.     CL = minutes (0-59)
  5230.     DH = seconds (0-59)
  5231.     DL = hundredths (0-99)
  5232.  
  5233.  
  5234. ───────────────────────────────────────────────────────────────────────────────
  5235. Function 2Dh - Set Time
  5236. ───────────────────────────────────────────────────────────────────────────────
  5237.  
  5238. In:
  5239.     AH = 2D
  5240.     CH = hour (0-23)
  5241.     CL = minutes (0-59)
  5242.     DH = seconds (0-59)
  5243.     DL = hundredths (0-99)
  5244.  
  5245. Out:
  5246.     AL = 00 if time change successful
  5247.        = FF if time invalid
  5248.  
  5249.  
  5250. ───────────────────────────────────────────────────────────────────────────────
  5251. Function 2Eh - Set/Reset Verify Switch
  5252. ───────────────────────────────────────────────────────────────────────────────
  5253.  
  5254. In:
  5255.     AH = 2E
  5256.     AL = 00 to set off
  5257.        = 01 to set verify on
  5258.     DH = 00 for DOS versions before 3.0
  5259. Out:
  5260.  
  5261. ───────────────────────────────────────────────────────────────────────────────
  5262. Function 2Fh - Get Disk Transfer Address (DTA)
  5263. ───────────────────────────────────────────────────────────────────────────────
  5264.  
  5265. In:
  5266.     AH = 2F
  5267. Out:
  5268.         ES:EBX = pointer to current DTA
  5269.  
  5270.  
  5271. ───────────────────────────────────────────────────────────────────────────────
  5272. Function 30h - Get DOS Version Number
  5273. ───────────────────────────────────────────────────────────────────────────────
  5274.  
  5275. In:
  5276.     AH = 30h
  5277. Out:
  5278.     AL = major version number (2-5)
  5279.     AH = minor version number (in hundredths decimal)
  5280.  
  5281.  
  5282. ───────────────────────────────────────────────────────────────────────────────
  5283. Function 33h - Get/Set System Values (Ctl-Break/Boot Drive)
  5284. ───────────────────────────────────────────────────────────────────────────────
  5285.  
  5286. In:
  5287.     AH = 33h
  5288.     AL = 00 to get Ctrl-Break checking flag
  5289.        = 01 to set Ctrl-Break checking flag
  5290.        = 02 to set extended Ctrl-Break checking
  5291.            = 05 get boot drive
  5292.     DL = 00 to set Ctrl-Break checking off
  5293.        = 01 to set Ctrl-Break checking on
  5294.            = boot drive for subfunction 5
  5295.  
  5296. Out:
  5297.     DL = 00 Ctrl-Break checking OFF (AL=0 or AL=2)
  5298.        = 01 Ctrl-Break checking ON    (AL=0 or AL=2)
  5299.            = boot drive number (1-26, A:h - Z:) (AL=5)
  5300.  
  5301.  
  5302. ───────────────────────────────────────────────────────────────────────────────
  5303. Function 34h - Get Address to DOS Critical Flag
  5304. ───────────────────────────────────────────────────────────────────────────────
  5305.  
  5306. In:
  5307.     AH = 34h
  5308. Out:
  5309.         ES:EBX = address of a byte indicating whether a DOS call is
  5310.         in progress.  No DOS calls should be made if set.
  5311.  
  5312.  
  5313. ───────────────────────────────────────────────────────────────────────────────
  5314. Function 35h - Get Interrupt Vector
  5315. ───────────────────────────────────────────────────────────────────────────────
  5316.  
  5317. In:
  5318.     AH = 35h
  5319.     AL = interrupt vector number
  5320. Out:
  5321.         ES:EBX = pointer to interrupt handler
  5322.  
  5323.  
  5324. ───────────────────────────────────────────────────────────────────────────────
  5325. Function 36h - Get Disk Free Space
  5326. ───────────────────────────────────────────────────────────────────────────────
  5327.  
  5328. In:
  5329.     AH = 36h
  5330.         DL = drive number
  5331. Out:
  5332.     AX = sectors per cluster
  5333.        = FFFF if drive is invalid
  5334.     BX = number of available clusters
  5335.     CX = number of bytes per sector
  5336.     DX = number of clusters per drive
  5337.  
  5338.  
  5339. ───────────────────────────────────────────────────────────────────────────────
  5340. Function 37h - Get/Set Switch Character
  5341. ───────────────────────────────────────────────────────────────────────────────
  5342.  
  5343. In:
  5344.     AH = 37h
  5345.     AL = 0    get switch character into DL;  some systems return "-"
  5346.        = 1    set switch character to value in DL
  5347.        = 2    read device prefix flag into DL;  returns DL = 0 indicating
  5348.         devices must be accessed using /DEV/device. A non-zero value
  5349.         indicates devices may be accessed without prefix
  5350.        = 3    set device prefix flag, device names must begin with \DEV\.
  5351.     DL = new switch character (AL=1)
  5352.        = 00  \DEV\ must preceed device names (AL=3)
  5353.            = 01  \DEV\ is not neccesary in device names (AL=3)
  5354. Out:
  5355.     AL = FF  illegal subfunction code specified
  5356.     DL = current switch character (AL=0)
  5357.        = device availability (AL=2, always FF with DOS 4.x+)
  5358.  
  5359.  
  5360. ───────────────────────────────────────────────────────────────────────────────
  5361. Function 39h - Create Subdirectory
  5362. ───────────────────────────────────────────────────────────────────────────────
  5363.  
  5364. In:
  5365.     AH = 39h
  5366.         DS:EDX = pointer to ASCIIZ path name
  5367. Out:
  5368.        Carry = 0 if successful
  5369.  
  5370.        Carry = 1 if error
  5371.         EAX = error code
  5372.  
  5373.  
  5374. ───────────────────────────────────────────────────────────────────────────────
  5375. Function 3Ah - Remove Subdirectory
  5376. ───────────────────────────────────────────────────────────────────────────────
  5377.  
  5378.  
  5379. In:
  5380.     AH = 3A
  5381.         DS:EDX = pointer to ASCIIZ path name
  5382. Out:
  5383.        Carry = 0 if successful
  5384.  
  5385.        Carry = 1 if error
  5386.         EAX = error code
  5387.  
  5388.  
  5389. ───────────────────────────────────────────────────────────────────────────────
  5390. Function 3Bh - Change Current Directory
  5391. ───────────────────────────────────────────────────────────────────────────────
  5392.  
  5393. In:
  5394.     AH = 3B
  5395.         DS:EDX = pointer to ASCIIZ path name
  5396. Out:
  5397.        Carry = 0 if successful
  5398.  
  5399.        Carry = 1 if error
  5400.         EAX = error code
  5401.  
  5402.  
  5403. ───────────────────────────────────────────────────────────────────────────────
  5404. Function 3Ch - Create File Using Handle
  5405. ───────────────────────────────────────────────────────────────────────────────
  5406.  
  5407.  
  5408.     AH = 3C
  5409.         CX = file attribute
  5410.         DS:EDX = pointer to ASCIIZ path name
  5411. Out:
  5412.        Carry = 0 if successful
  5413.         AX = files handle
  5414.        Carry = 1 if error
  5415.         EAX = error code
  5416.  
  5417.  
  5418. ───────────────────────────────────────────────────────────────────────────────
  5419. Function 3Dh - Open File Using Handle
  5420. ───────────────────────────────────────────────────────────────────────────────
  5421.  
  5422.     AH = 3D
  5423.     AL = open access mode
  5424.         DS:EDX = pointer to an ASCIIZ file name
  5425. Out:
  5426.        Carry = 0 if successful
  5427.         AX = files handle
  5428.        Carry = 1 if error
  5429.         EAX = error code
  5430.  
  5431.  
  5432. ───────────────────────────────────────────────────────────────────────────────
  5433. Function 3Eh - Close File Using Handle
  5434. ───────────────────────────────────────────────────────────────────────────────
  5435.  
  5436. In:
  5437.     AH = 3E
  5438.     BX = file handle to close
  5439. Out:
  5440.        Carry = 0 if successful
  5441.  
  5442.        Carry = 1 if error
  5443.         EAX = error code
  5444.  
  5445.  
  5446. ───────────────────────────────────────────────────────────────────────────────
  5447. Function 3Fh - Read From File or Device Using Handle
  5448. ───────────────────────────────────────────────────────────────────────────────
  5449.  
  5450. In:
  5451.     AH = 3F
  5452.     BX = file handle
  5453.         ECX = number of bytes to read
  5454.         DS:EDX = pointer to read buffer
  5455. Out:
  5456.        Carry = 0 if successful
  5457.         EAX = Number of bytes readen
  5458.        Carry = 1 if error
  5459.         EAX = error code
  5460.  
  5461.  
  5462. ───────────────────────────────────────────────────────────────────────────────
  5463. Function 40h - Write To File or Device Using Handle
  5464. ───────────────────────────────────────────────────────────────────────────────
  5465.  
  5466. In:
  5467.     AH = 40h
  5468.     BX = file handle
  5469.         ECX = number of bytes to write
  5470.         DS:EDX = pointer to write buffer
  5471. Out:
  5472.        Carry = 0 if successful
  5473.         EAX = Number of bytes written
  5474.        Carry = 1 if error
  5475.         EAX = error code
  5476.  
  5477.  
  5478. ───────────────────────────────────────────────────────────────────────────────
  5479. Function 41h - Delete File
  5480. ───────────────────────────────────────────────────────────────────────────────
  5481.  
  5482. In:
  5483.     AH = 41h
  5484.         DS:EDX = pointer to an ASCIIZ filename
  5485. Out:
  5486.        Carry = 0 if successful
  5487.  
  5488.        Carry = 1 if error
  5489.         EAX = error code
  5490.  
  5491.  
  5492. ───────────────────────────────────────────────────────────────────────────────
  5493. Function 42h - Move File Pointer Using Handle
  5494. ───────────────────────────────────────────────────────────────────────────────
  5495.  
  5496. In:
  5497.     AH = 42h
  5498.         AL = origin of move
  5499.     BX = file handle
  5500.     CX = high order word of number of bytes to move
  5501.     DX = low order word of number of bytes to move
  5502.  
  5503. Out:
  5504.        Carry = 0 if successful
  5505.         DX:AX = new pointer location
  5506.        Carry = 1 if error
  5507.         EAX = error code
  5508.  
  5509.  
  5510. ───────────────────────────────────────────────────────────────────────────────
  5511. Function 43h - Get/Set File Attributes
  5512. ───────────────────────────────────────────────────────────────────────────────
  5513.  
  5514. In:
  5515.     AH = 43h
  5516.     AL = 00 to get attribute
  5517.        = 01 to set attribute
  5518.         DS:EDX = pointer to an ASCIIZ path name
  5519.     CX = attribute to set
  5520. Out:
  5521.        Carry = 0 if successful
  5522.  
  5523.        Carry = 1 if error
  5524.         EAX = error code
  5525.  
  5526.  
  5527. ───────────────────────────────────────────────────────────────────────────────
  5528. Function 45h - Duplicate File Handle
  5529. ───────────────────────────────────────────────────────────────────────────────
  5530.  
  5531. In:
  5532.     AH = 45h
  5533.     BX = file handle
  5534. Out:
  5535.        Carry = 0 if successful
  5536.         AX = New handle
  5537.        Carry = 1 if error
  5538.         EAX = error code
  5539.  
  5540.  
  5541. ───────────────────────────────────────────────────────────────────────────────
  5542. Function 46h - Force Duplicate File Handle
  5543. ───────────────────────────────────────────────────────────────────────────────
  5544.  
  5545. In:
  5546.     AH = 46h
  5547.     BX = existing file handle
  5548.     CX = second file handle
  5549. Out:
  5550.        Carry = 0 if successful
  5551.  
  5552.        Carry = 1 if error
  5553.         EAX = error code
  5554.  
  5555.  
  5556. ───────────────────────────────────────────────────────────────────────────────
  5557. Function 47h - Get Current Directory
  5558. ───────────────────────────────────────────────────────────────────────────────
  5559.  
  5560. In:
  5561.     AH = 47h
  5562.         DL = drive number
  5563.         DS:ESI = pointer to a 64 byte user buffer
  5564. Out:
  5565.        Carry = 0 if successful
  5566.         DS:ESI = pointer ASCIIZ directory path string
  5567.        Carry = 1 if error
  5568.         EAX = error code
  5569.  
  5570.  
  5571. ───────────────────────────────────────────────────────────────────────────────
  5572. Function 48h - Allocate Memory
  5573. ───────────────────────────────────────────────────────────────────────────────
  5574.  
  5575. In:
  5576.     AH = 48h
  5577.     BX = number of memory paragraphs requested
  5578. Out:
  5579.        Carry = 0 if successful
  5580.         EAX = selector for memory block
  5581.         EBX = ??????
  5582.  
  5583.        Carry = 1 if error
  5584.         EAX = error code
  5585.         EBX = size in paras of the largest block of memory available
  5586. Notes:
  5587.         EBX may be random
  5588.  
  5589.  
  5590. ───────────────────────────────────────────────────────────────────────────────
  5591. Function 49h - Free Allocated Memory
  5592. ───────────────────────────────────────────────────────────────────────────────
  5593.  
  5594.  
  5595. In:
  5596.     AH = 49h
  5597.         ES = selector of the memory block
  5598. Out:
  5599.        Carry = 0 if successful
  5600.         EBX = ??????
  5601.  
  5602.        Carry = 1 if error
  5603.         EAX = error code
  5604. Notes:
  5605.         EBX may be random
  5606.  
  5607.  
  5608. ───────────────────────────────────────────────────────────────────────────────
  5609. Function 4Ah - Modify Allocated Memory Block  (SETBLOCK)
  5610. ───────────────────────────────────────────────────────────────────────────────
  5611.  
  5612. In:
  5613.     AH = 4A
  5614.     BX = new requested block size in paragraphs
  5615.     ES = segment of the block (~MCB~ + 1 para)
  5616. Out:
  5617.        Carry = 0 if successful
  5618.         EBX = ??????
  5619.  
  5620.        Carry = 1 if error
  5621.         EAX = error code
  5622.         EBX = size in paras of the largest block of memory available
  5623.  
  5624.  
  5625. ───────────────────────────────────────────────────────────────────────────────
  5626. Function 4Bh - Load and Execute Program
  5627. ───────────────────────────────────────────────────────────────────────────────
  5628.  
  5629. In:
  5630.     AH = 4B
  5631.     AL = 00  to load and execute program
  5632.         DS:EDX = pointer to an ASCIIZ filename
  5633.         ES:EBX = pointer to a parameter block
  5634. Out:
  5635.        Carry = 0 if successful
  5636.  
  5637.        Carry = 1 if error
  5638.         EAX = error code
  5639.  
  5640.  
  5641. ───────────────────────────────────────────────────────────────────────────────
  5642. Function 4Ch - Terminate Process With Return Code
  5643. ───────────────────────────────────────────────────────────────────────────────
  5644.  
  5645. In:
  5646.     AH = 4C
  5647.         AL = return code
  5648. Out:
  5649.  
  5650.  
  5651. ───────────────────────────────────────────────────────────────────────────────
  5652. Function 4Dh - Get Return Code of Sub-process
  5653. ───────────────────────────────────────────────────────────────────────────────
  5654.  
  5655. In:
  5656.     AH = 4D
  5657. Out:
  5658.     AH = system exit code  (indicates normal termination)
  5659.        = 00 for normal termination
  5660.        = 01 if terminated by ctl-break
  5661.        = 02 if critical device error
  5662.     AL = child exit code
  5663.  
  5664.  
  5665. ───────────────────────────────────────────────────────────────────────────────
  5666. Function 4Eh - Find First Matching File
  5667. ───────────────────────────────────────────────────────────────────────────────
  5668.  
  5669. In:
  5670.     AH = 4E
  5671.         CX = attribute used during search
  5672.         DS:EDX = pointer to ASCIIZ filespec
  5673. Out:
  5674.        Carry = 0 if successful
  5675.  
  5676.        Carry = 1 if error
  5677.         EAX = error code
  5678.  
  5679.  
  5680. ───────────────────────────────────────────────────────────────────────────────
  5681. Function 4Fh - Find Next Matching File
  5682. ───────────────────────────────────────────────────────────────────────────────
  5683.  
  5684. In:
  5685.     AH = 4F
  5686.         DS:EDX = unchanged from previous function 4E
  5687. Out:
  5688.        Carry = 0 if successful
  5689.  
  5690.        Carry = 1 if error
  5691.         EAX = error code
  5692.  
  5693.  
  5694. ───────────────────────────────────────────────────────────────────────────────
  5695. Function 54h - Get Verify Setting
  5696. ───────────────────────────────────────────────────────────────────────────────
  5697.  
  5698. In:
  5699.     AH = 54h
  5700. Out:
  5701.     AL = 00  verify off
  5702.        = 01  verify on
  5703.  
  5704.  
  5705. ───────────────────────────────────────────────────────────────────────────────
  5706. Function 56h - Rename File
  5707. ───────────────────────────────────────────────────────────────────────────────
  5708.  
  5709. In:
  5710.     AH = 56h
  5711.         DS:EDX = pointer to old ASCIIZ path/filename
  5712.         ES:EDI = pointer to new ASCIIZ path/filename
  5713. Out:
  5714.        Carry = 0 if successful
  5715.  
  5716.        Carry = 1 if error
  5717.         EAX = error code
  5718.  
  5719.  
  5720. ───────────────────────────────────────────────────────────────────────────────
  5721. Function 58h - Get/Set Memory Allocation Strategy
  5722. ───────────────────────────────────────────────────────────────────────────────
  5723.  
  5724. In:
  5725.     AH = 58h
  5726.     AL = 00  get strategy code
  5727.        = 01  set strategy code
  5728.     BX = strategy code (when AL = 01)
  5729.        = 00  first fit  (default)
  5730.        = 01  best fit
  5731.        = 02  last fit
  5732. Out:
  5733.        Carry = 0 if successful
  5734.  
  5735.        Carry = 1 if error
  5736.         EAX = error code
  5737.  
  5738.  
  5739. ───────────────────────────────────────────────────────────────────────────────
  5740. Function 59h - Get Extended Error Information
  5741. ───────────────────────────────────────────────────────────────────────────────
  5742.  
  5743. In:
  5744.     AH = 59h
  5745.         BX = 00
  5746. Out:
  5747.        Carry = 0 if successful
  5748.         AX = error code
  5749.         BH = error class
  5750.     BL = suggested action
  5751.     CH = locus
  5752.  
  5753.        Carry = 1 if error
  5754.  
  5755.  
  5756. ───────────────────────────────────────────────────────────────────────────────
  5757. Function 5Ah - Create Temporary File
  5758. ───────────────────────────────────────────────────────────────────────────────
  5759.  
  5760. In:
  5761.     AH = 5A
  5762.     CX = attribute
  5763.         DS:EDX = pointer to ASCIIZ path ending in '\'
  5764. Out:
  5765.        Carry = 0 if successful
  5766.         AX = handle
  5767.         DS:EDX = pointer to updated ASCIIZ filespec
  5768.  
  5769.        Carry = 1 if error
  5770.         EAX = error code
  5771.  
  5772.  
  5773. ───────────────────────────────────────────────────────────────────────────────
  5774. Function 5Bh - Create File
  5775. ───────────────────────────────────────────────────────────────────────────────
  5776.  
  5777.  
  5778.     AH = 5B
  5779.     CX = attribute
  5780.         DS:EDX = pointer to ASCIIZ path/filename
  5781.  
  5782.  
  5783.        Carry = 0 if successful
  5784.         AX = handle
  5785.  
  5786.        Carry = 1 if error
  5787.         EAX = error code
  5788.  
  5789.  
  5790. ───────────────────────────────────────────────────────────────────────────────
  5791. Function 60h - Get Fully Qualified File Name
  5792. ───────────────────────────────────────────────────────────────────────────────
  5793.  
  5794. In:
  5795.     AH = 60h
  5796.         DS:ESI = pointer to ASCIIZ string containing unqualified filename
  5797.         ES:EDI = pointer to 128 byte buffer to contain fully qualified filename
  5798. Out:
  5799.        Carry = 0 if successful
  5800.         ES:EDI = address of fully qualified filename string
  5801.  
  5802.        Carry = 1 if error
  5803.         EAX = error code
  5804.  
  5805.  
  5806. ╔══════════════════════════════════════════════════════════════════════════╗
  5807. ║                                                                          ║
  5808. ║ Fin de la documentation EOS                                              ║
  5809. ║                                                                          ║
  5810. ╚══════════════════════════════════════════════════════════════════════════╝